summaryrefslogtreecommitdiffstats
path: root/man2html/scripts/cgi-bin/man/mansearchhelp
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-09-13 09:43:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-09-13 09:43:21 -0700
commit5280f9a0cd1f9ba200422ebba65d1e0133410995 (patch)
treebf85ce4e320a769d7e0903ff52ccfde13a422666 /man2html/scripts/cgi-bin/man/mansearchhelp
downloadman-5280f9a0cd1f9ba200422ebba65d1e0133410995.tar.gz
man-5280f9a0cd1f9ba200422ebba65d1e0133410995.tar.bz2
man-5280f9a0cd1f9ba200422ebba65d1e0133410995.zip
Initial.man-1.6g
Diffstat (limited to 'man2html/scripts/cgi-bin/man/mansearchhelp')
-rwxr-xr-xman2html/scripts/cgi-bin/man/mansearchhelp32
1 files changed, 32 insertions, 0 deletions
diff --git a/man2html/scripts/cgi-bin/man/mansearchhelp b/man2html/scripts/cgi-bin/man/mansearchhelp
new file mode 100755
index 0000000..a96e796
--- /dev/null
+++ b/man2html/scripts/cgi-bin/man/mansearchhelp
@@ -0,0 +1,32 @@
+#!/bin/sh
+MAN2HTML=/usr/bin/man2html
+MANSH=/home/httpd/cgi-aux/man/mansearchhelp.aux
+
+# Do we need lynxcgi URLs? For the moment our criterion is
+# 1) HTTP_USER_AGENT=Lynx* and 2) HTTP_HOST is unset.
+AGENT="${HTTP_USER_AGENT-unknown}"
+case "$AGENT" in
+ Lynx*|lynx*)
+ HH="${HTTP_HOST-nohh}"
+ ;;
+ *)
+ HH=nolynx
+ ;;
+esac
+
+SERVER="${SERVER_NAME-localhost}"
+case "$HH" in
+ nohh)
+ CG="lynxcgi:/home/httpd/cgi-bin/man"
+ ;;
+ *)
+ CG="http://$SERVER/cgi-bin/man"
+ ;;
+esac
+
+if [ -r $MANSH ]; then
+ sed s#%cg#$CG#g $MANSH
+else
+ $MAN2HTML -E "man2html: cannot open $MANSH"
+fi
+exit 0