changeset 521:356320f803dc

Option "-w" enables CGI wrapper
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 06 Apr 2019 17:41:27 +0900
parents 0d8785102531
children 9060df7f079b
files s4-start.sh
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/s4-start.sh	Sat Apr 06 17:35:07 2019 +0900
+++ b/s4-start.sh	Sat Apr 06 17:41:27 2019 +0900
@@ -20,16 +20,18 @@
 	-f		Force overwriting
 	-g		Guestonly mode(No login required)
 	-t TYPE		Construction type (defaults to $TYPE)
+	-w		Create CGI wrapper
 
 TYPEs are one of directory names in examples except \`common'.
 EOF
   exit 0
 }
-while getopts a:fght: f; do
+while getopts a:fght:w f; do
   case $f in
     a)	ADMIN=$OPTARG;;
     g)	guest=1;;
     f)	force=1;;
+    w)	wrap=1;;
     t)	TYPE=$OPTARG;;
     \?|h)     usage; exit 1;;
   esac
@@ -94,7 +96,8 @@
 	DirectoryIndex	index.cgi
 	AddHandler cgi-script .cgi
 	EOF
-    if [ pwrap.c -nt index.cgi ]; then
+    if [ -n "$wrap" -a pwrap.c -nt index.cgi ]; then
+      mv -f index.cgi s4.cgi &&
       ${CC:-gcc} -o index.cgi pwrap.c \
 	&& chmod u+s index.cgi \
 	&& rc=0

yatex.org