summaryrefslogtreecommitdiff
path: root/gosher
diff options
context:
space:
mode:
Diffstat (limited to 'gosher')
-rwxr-xr-xgosher6
1 files changed, 5 insertions, 1 deletions
diff --git a/gosher b/gosher
index a0fa98b..668a2db 100755
--- a/gosher
+++ b/gosher
@@ -160,6 +160,9 @@ serve_redirect(){
Click to be redirected to: <a href="$url">$url</a>
</body>
EOF
+ exec 1>&-
+ exec 2>&-
+ exit 0
}
@@ -178,7 +181,7 @@ selector=$(echo $selector | sed -r 's:\$.*::g;s:\r::g' )
}
case $selector in
- /URL:*)
+ URL:*)
url=$(echo $selector | cut -d ":" -f 2-)
serve_redirect $url
;;
@@ -205,6 +208,7 @@ case $selector in
*)
[ -f "${GOPHERDIR}/gophermap" ] && serve_selector "${GOPHERDIR}/gophermap"
[ -f "${GOPHERDIR}/index.gph" ] && serve_index "${GOPHERDIR}/index.gph"
+ echo "got invalid selector: \"$selector\"" >&2
invalid_selector "/"
;;
esac