instaweb: Be more clear if httpd or the browser fail
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin committed
Jul 26, 2006 at 23:11 UTC
5209eda86363a3ba2e000903ad8de29589b18b58
1 file changed
+7
-2
git-instaweb.sh
+7
-2
@@ -54,6 +54,10 @@ start_httpd () {
54
fi
55
done
56
fi
57
+ if test $? != 0; then
58
+ echo "Could not execute http daemon $httpd."
59
+ exit 1
60
+ fi
61
}
62
63
stop_httpd () {
@@ -184,7 +188,7 @@ EOF
188
else
189
# plain-old CGI
190
list_mods=`echo "$httpd" | sed "s/-f$/-l/"`
187
- $list_mods | grep 'mod_cgi\.c' >/dev/null || \
191
+ $list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
192
echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
193
cat >> "$conf" <<EOF
194
AddHandler cgi-script .cgi
@@ -234,4 +238,5 @@ esac
238
239
start_httpd
240
test -z "$browser" && browser=echo
237
-$browser http://127.0.0.1:$port
241
+url=http://127.0.0.1:$port
242
+$browser $url || echo $url