Merge branch 'sb/remove-unused-var-from-builtin-add' into maint
[git] / contrib / mw-to-git / t / install-wiki.sh
1 #!/bin/sh
2
3 # This script installs or deletes a MediaWiki on your computer.
4 # It requires a web server with PHP and SQLite running. In addition, if you
5 # do not have MediaWiki sources on your computer, the option 'install'
6 # downloads them for you.
7 # Please set the CONFIGURATION VARIABLES in ./test-gitmw-lib.sh
8
9 WIKI_TEST_DIR=$(cd "$(dirname "$0")" && pwd)
10
11 if test -z "$WIKI_TEST_DIR"
12 then
13         WIKI_TEST_DIR=.
14 fi
15
16 . "$WIKI_TEST_DIR"/test-gitmw-lib.sh
17 usage () {
18         echo "usage: "
19         echo "  ./install-wiki.sh <install | delete | --help>"
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
28 # Argument: install, delete, --help | -h
29 case "$1" in
30         "install" | "-i")
31                 wiki_install
32                 exit 0
33                 ;;
34         "delete" | "-d")
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
49                 ;;
50         *)
51                 echo "Invalid argument: $1"
52                 usage
53                 exit 1
54                 ;;
55 esac