summaryrefslogtreecommitdiff
path: root/git-instaweb.sh
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-06-23 19:55:00 (GMT)
committerEric Wong <normalperson@yhbt.net>2011-06-27 09:11:41 (GMT)
commitdb61f060be5bc00cc9a44df694bac4ee4b65d02d (patch)
treeef373fc1ef0ef78df476395b9d2167790a3360fd /git-instaweb.sh
parentf696543dad6c7ba27b0c4fab167a5687263a9ba0 (diff)
downloadgit-db61f060be5bc00cc9a44df694bac4ee4b65d02d.zip
git-db61f060be5bc00cc9a44df694bac4ee4b65d02d.tar.gz
git-db61f060be5bc00cc9a44df694bac4ee4b65d02d.tar.bz2
git-instaweb: Extract configuring web server into configure_httpd
This is preparatory work for making start/restart check that git-instaweb set up correct configuration, and generate it if it is missing. Pure refactoring, no functional changes. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-instaweb.sh')
-rwxr-xr-xgit-instaweb.sh46
1 files changed, 25 insertions, 21 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 8bfa8a0..49bab7b 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -587,32 +587,36 @@ our \$projects_list = \$projectroot;
EOF
}
+configure_httpd() {
+ case "$httpd" in
+ *lighttpd*)
+ lighttpd_conf
+ ;;
+ *apache2*|*httpd*)
+ apache2_conf
+ ;;
+ webrick)
+ webrick_conf
+ ;;
+ *mongoose*)
+ mongoose_conf
+ ;;
+ *plackup*)
+ plackup_conf
+ ;;
+ *)
+ echo "Unknown httpd specified: $httpd"
+ exit 1
+ ;;
+ esac
+}
+
gitweb_conf
resolve_full_httpd
mkdir -p "$fqgitdir/gitweb/$httpd_only"
-case "$httpd" in
-*lighttpd*)
- lighttpd_conf
- ;;
-*apache2*|*httpd*)
- apache2_conf
- ;;
-webrick)
- webrick_conf
- ;;
-*mongoose*)
- mongoose_conf
- ;;
-*plackup*)
- plackup_conf
- ;;
-*)
- echo "Unknown httpd specified: $httpd"
- exit 1
- ;;
-esac
+configure_httpd
start_httpd
url=http://127.0.0.1:$port