[PATCH] instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2.
Signed-off-by: nathan spindel <nathans@gmail.com>
---
git-instaweb.sh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6f91c8f..b744133 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -31,8 +31,16 @@ conf="$GIT_DIR/gitweb/httpd.conf"
# Defaults:
-# if installed, it doesn't need further configuration (module_path)
-test -z "$httpd" && httpd='lighttpd -f'
+# use lighttpd if it exists, otherwise use apache2
+if test -z "$httpd"
+then
+ if type "lighttpd" > /dev/null 2>&1;
+ then
+ httpd="lighttpd -f"
+ else
+ httpd="apache2 -f"
+ fi
+fi
# any untaken local port will do...
test -z "$port" && port=1234
--
1.5.5.1.179.g2fe4.dirty