git-remote-mediawiki: allow stop/start-ing the test server
Previously, the user had to launch a complete re-install after a lighttpd stop (e.g. a reboot). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Apr 23, 2014 at 16:34 UTC
1c4ea83902e2a64472ccf99ced4ea773ad3dd8aa
2 files changed
+11
-1
contrib/mw-to-git/t/install-wiki.sh
+10
@@ -20,6 +20,8 @@ usage () {
20
echo " install | -i : Install a wiki on your computer."
21
echo " delete | -d : Delete the wiki and all its pages and "
22
echo " content."
23
+ echo " start | -s : Start the previously configured lighttpd daemon"
24
+ echo " stop : Stop lighttpd daemon."
25
}
26
27
@@ -33,6 +35,14 @@ case "$1" in
35
wiki_delete
36
exit 0
37
;;
38
+ "start" | "-s")
39
+ start_lighttpd
40
+ exit
41
+ ;;
42
+ "stop")
43
+ stop_lighttpd
44
+ exit
45
+ ;;
46
"--help" | "-h")
47
usage
48
exit 0
contrib/mw-to-git/t/test-gitmw-lib.sh
+1
-1
@@ -289,7 +289,6 @@ start_lighttpd () {
289
# Kill daemon lighttpd and removes files and folders associated.
290
stop_lighttpd () {
291
test -f "$WEB_TMP/pid" && kill $(cat "$WEB_TMP/pid")
292
- rm -rf "$WEB"
292
}
293
294
# Create the SQLite database of the MediaWiki. If the database file already
@@ -415,6 +414,7 @@ wiki_reset () {
414
wiki_delete () {
415
if test $LIGHTTPD = "true"; then
416
stop_lighttpd
417
+ rm -fr "$WEB"
418
else
419
# Delete the wiki's directory.
420
rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||