-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit
executable file
·50 lines (42 loc) · 934 Bytes
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
curdir=$(cd $(dirname $0) && pwd)
usage() {
echo "ERROR: action missing"
echo "syntax: $0 <start|stop|restart|status|config|install|uninstall>"
echo "example: $0 start"
}
enableWelcomePage() {
/system/sbin/welcomePage.sh start
}
disableWelcomePage() {
/system/sbin/welcomePage.sh stop
}
install() {
/system/sbin/welcomePage.sh config init $curdir/welcome.html
}
uninstall() {
/system/sbin/welcomePage.sh config clean $curdir/welcome.html
}
# main
case "$1" in
"start" | "restart" )
install
enableWelcomePage ;;
"stop" )
disableWelcomePage ;;
"status" )
echo "welcome page status" ;;
"config" )
echo "configured" ;;
"install" )
install
enableWelcomePage
echo "installed" ;;
"uninstall" )
disableWelcomePage
uninstall
echo "uninstalled" ;;
* )
usage ;;
esac
exit $?