s4

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 diff
     1.1 --- a/s4-start.sh	Sat Apr 06 17:35:07 2019 +0900
     1.2 +++ b/s4-start.sh	Sat Apr 06 17:41:27 2019 +0900
     1.3 @@ -20,16 +20,18 @@
     1.4  	-f		Force overwriting
     1.5  	-g		Guestonly mode(No login required)
     1.6  	-t TYPE		Construction type (defaults to $TYPE)
     1.7 +	-w		Create CGI wrapper
     1.8  
     1.9  TYPEs are one of directory names in examples except \`common'.
    1.10  EOF
    1.11    exit 0
    1.12  }
    1.13 -while getopts a:fght: f; do
    1.14 +while getopts a:fght:w f; do
    1.15    case $f in
    1.16      a)	ADMIN=$OPTARG;;
    1.17      g)	guest=1;;
    1.18      f)	force=1;;
    1.19 +    w)	wrap=1;;
    1.20      t)	TYPE=$OPTARG;;
    1.21      \?|h)     usage; exit 1;;
    1.22    esac
    1.23 @@ -94,7 +96,8 @@
    1.24  	DirectoryIndex	index.cgi
    1.25  	AddHandler cgi-script .cgi
    1.26  	EOF
    1.27 -    if [ pwrap.c -nt index.cgi ]; then
    1.28 +    if [ -n "$wrap" -a pwrap.c -nt index.cgi ]; then
    1.29 +      mv -f index.cgi s4.cgi &&
    1.30        ${CC:-gcc} -o index.cgi pwrap.c \
    1.31  	&& chmod u+s index.cgi \
    1.32  	&& rc=0