-
Notifications
You must be signed in to change notification settings - Fork 0
/
init
executable file
·84 lines (67 loc) · 1.89 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
CURWDIR="$(cd $(dirname $0) && pwd)"
TITLE="KMS"
PROGRAM_NAME="app-kms"
CUSTOM_BIN="/system/apps/tp/bin/custom"
CUSTOM_CONFIG_FILE="$CURWDIR/custom.conf"
APPS_CONFIG_DIR="/data/conf"
LAUNCHER_CONFIG_DIR="$APPS_CONFIG_DIR/launcher/conf.d"
LAUNCHER_CONFIG_FILE="$LAUNCHER_CONFIG_DIR/$PROGRAM_NAME.conf"
ICON="./res/kms.png"
PRESSED_ICON="./res/kms.png"
PID_FILE="$CURWDIR/$PROGRAM_NAME.pid"
PKILL_BIN="/usr/bin/pkill"
INSTALL_BIN="/usr/bin/install"
REMOVE="/bin/rm -f"
usage() {
echo "ERROR: action missing"
echo "syntax: $0 <start|stop|restart|status|config|install|uninstall>"
echo "example: $0 start"
}
start() {
$CURWDIR/bin/vlmcsd &
#/system/sbin/appInfo.sh set_status $PACKAGEID ISRUNNING
messagebox KMS激活服务器 愉快的在windows上激活吧!!! 2 后台运行 no_cmd 彻底退出 $CURWDIR/bin/kill
# progress -t KMS激活服务器 -m 愉快的在windows上激活吧 -p $CURWDIR/bin/kill &
}
stop() {
killall vlmcsd
/system/sbin/appInfo.sh set_status $PACKAGEID NOTRUNNING
return 0;
}
config() {
echo "{" > "$PROGRAM_NAME.conf"
echo "\"name\" : \"$TITLE\"," >> "$PROGRAM_NAME.conf"
echo "\"icon\" : \"$CURWDIR/$ICON\"," >> "$PROGRAM_NAME.conf"
echo "\"iconPressed\" : \"$CURWDIR/$PRESSED_ICON\"," >> "$PROGRAM_NAME.conf"
echo "\"exec\" : \"$CURWDIR/init start\"," >> "$PROGRAM_NAME.conf"
echo "\"msgNum\" : 4" >> "$PROGRAM_NAME.conf"
echo "}" >> "$PROGRAM_NAME.conf"
$INSTALL_BIN -d $LAUNCHER_CONFIG_DIR
$INSTALL_BIN "$PROGRAM_NAME.conf" "$LAUNCHER_CONFIG_FILE"
}
uninstall() {
$REMOVE "$LAUNCHER_CONFIG_FILE"
}
# main
if [ $# -lt 1 ]; then
usage
exit 255
fi
case "$1" in
"start" )
start;;
"stop" )
stop;;
"run" )
run;;
"restart" )
start
stop;;
"install" )
config;;
"uninstall" )
uninstall;;
* )
usage ;;
esac