Skip to content

Commit

Permalink
git-remote-mediawiki: allow stop/start-ing the test server
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Apr 23, 2014
1 parent 779792a commit 1c4ea83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions contrib/mw-to-git/t/install-wiki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ usage () {
echo " install | -i : Install a wiki on your computer."
echo " delete | -d : Delete the wiki and all its pages and "
echo " content."
echo " start | -s : Start the previously configured lighttpd daemon"
echo " stop : Stop lighttpd daemon."
}


Expand All @@ -33,6 +35,14 @@ case "$1" in
wiki_delete
exit 0
;;
"start" | "-s")
start_lighttpd
exit
;;
"stop")
stop_lighttpd
exit
;;
"--help" | "-h")
usage
exit 0
Expand Down
2 changes: 1 addition & 1 deletion contrib/mw-to-git/t/test-gitmw-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ start_lighttpd () {
# Kill daemon lighttpd and removes files and folders associated.
stop_lighttpd () {
test -f "$WEB_TMP/pid" && kill $(cat "$WEB_TMP/pid")
rm -rf "$WEB"
}

# Create the SQLite database of the MediaWiki. If the database file already
Expand Down Expand Up @@ -415,6 +414,7 @@ wiki_reset () {
wiki_delete () {
if test $LIGHTTPD = "true"; then
stop_lighttpd
rm -fr "$WEB"
else
# Delete the wiki's directory.
rm -rf "$WIKI_DIR_INST/$WIKI_DIR_NAME" ||
Expand Down

0 comments on commit 1c4ea83

Please sign in to comment.