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>
Jakub Narebski committed
Jun 23, 2011 at 21:55 UTC
db61f060be5bc00cc9a44df694bac4ee4b65d02d
1 file changed
+25
-21
git-instaweb.sh
+25
-21
@@ -587,32 +587,36 @@ our \$projects_list = \$projectroot;
587
EOF
588
}
589
590
+configure_httpd() {
591
+ case "$httpd" in
592
+ *lighttpd*)
593
+ lighttpd_conf
594
+ ;;
595
+ *apache2*|*httpd*)
596
+ apache2_conf
597
+ ;;
598
+ webrick)
599
+ webrick_conf
600
+ ;;
601
+ *mongoose*)
602
+ mongoose_conf
603
+ ;;
604
+ *plackup*)
605
+ plackup_conf
606
+ ;;
607
+ *)
608
+ echo "Unknown httpd specified: $httpd"
609
+ exit 1
610
+ ;;
611
+ esac
612
+}
613
+
614
gitweb_conf
615
616
resolve_full_httpd
617
mkdir -p "$fqgitdir/gitweb/$httpd_only"
618
595
-case "$httpd" in
596
-*lighttpd*)
597
- lighttpd_conf
598
- ;;
599
-*apache2*|*httpd*)
600
- apache2_conf
601
- ;;
602
-webrick)
603
- webrick_conf
604
- ;;
605
-*mongoose*)
606
- mongoose_conf
607
- ;;
608
-*plackup*)
609
- plackup_conf
610
- ;;
611
-*)
612
- echo "Unknown httpd specified: $httpd"
613
- exit 1
614
- ;;
615
-esac
619
+configure_httpd
620
621
start_httpd
622
url=http://127.0.0.1:$port