summaryrefslogtreecommitdiff
path: root/git-instaweb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-instaweb.sh')
-rwxr-xr-xgit-instaweb.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 69aef3c20b..16cd351f7f 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -25,7 +25,7 @@ conf=$GIT_DIR/gitweb/httpd.conf
# Defaults:
-# if installed, it doens't need further configuration (module_path)
+# if installed, it doesn't need further configuration (module_path)
test -z "$httpd" && httpd='lighttpd -f'
# probably the most popular browser among gitweb users
@@ -54,6 +54,10 @@ start_httpd () {
fi
done
fi
+ if test $? != 0; then
+ echo "Could not execute http daemon $httpd."
+ exit 1
+ fi
}
stop_httpd () {
@@ -183,8 +187,10 @@ PerlPassEnv GIT_EXEC_DIR
EOF
else
# plain-old CGI
+ list_mods=`echo "$httpd" | sed "s/-f$/-l/"`
+ $list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
+ echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
cat >> "$conf" <<EOF
-LoadModule cgi_module $module_path/mod_cgi.so
AddHandler cgi-script .cgi
<Location /gitweb.cgi>
Options +ExecCGI
@@ -232,4 +238,5 @@ esac
start_httpd
test -z "$browser" && browser=echo
-$browser http://127.0.0.1:$port
+url=http://127.0.0.1:$port
+$browser $url || echo $url