X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-instaweb.sh;h=341930ca9d74867cf334952fc47bb3afe95552b7;hb=c142465c07b7857ebb4816fe95c3d212aa825bcc;hp=d96eddbe56783d61304941a134361797c82480e7;hpb=aab748636dbbd6412af6f4996c2791eba4246c0c;p=git.git diff --git a/git-instaweb.sh b/git-instaweb.sh index d96eddbe5..341930ca9 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -41,7 +41,7 @@ resolve_full_httpd () { case "$httpd" in *apache2*|*lighttpd*) # ensure that the apache2/lighttpd command ends with "-f" - if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1 + if ! echo "$httpd" | sane_grep -- '-f *$' >/dev/null 2>&1 then httpd="$httpd -f" fi @@ -73,6 +73,11 @@ resolve_full_httpd () { } start_httpd () { + if test -f "$fqgitdir/pid"; then + say "Instance already running. Restarting..." + stop_httpd + fi + # here $httpd should have a meaningful value resolve_full_httpd @@ -297,8 +302,8 @@ EOF # check to see if Dennis Stosberg's mod_perl compatibility patch # (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied - if test -f "$module_path/mod_perl.so" && grep 'MOD_PERL' \ - "$GIT_DIR/gitweb/gitweb.cgi" >/dev/null + if test -f "$module_path/mod_perl.so" && + sane_grep 'MOD_PERL' "$GIT_DIR/gitweb/gitweb.cgi" >/dev/null then # favor mod_perl if available cat >> "$conf" </dev/null 2>&1 || \ - echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" + $list_mods | sane_grep 'mod_cgi\.c' >/dev/null 2>&1 || \ + if test -f "$module_path/mod_cgi.so" + then + echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" + else + $list_mods | grep 'mod_cgid\.c' >/dev/null 2>&1 || \ + if test -f "$module_path/mod_cgid.so" + then + echo "LoadModule cgid_module $module_path/mod_cgid.so" \ + >> "$conf" + else + echo "You have no CGI support!" + exit 2 + fi + echo "ScriptSock logs/gitweb.sock" >> "$conf" + fi cat >> "$conf" <