-
Notifications
You must be signed in to change notification settings - Fork 3
/
script
65 lines (51 loc) · 817 Bytes
/
script
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
#!/bin/sh
install()
{
cp -r etc /
cp -r usr /
cat MORE >> /etc/xfrpc/xfrpc.ini
chmod +x /usr/sbin/xfrpc
chmod +x /etc/init.d/xfrpc
return 0
}
uninstall()
{
stop
rm -rf /etc/init.d/xfrpc
rm -rf /usr/sbin/xfrpc
return 0
}
start()
{
/etc/init.d/xfrpc start
/etc/init.d/xfrpc enable
return 0
}
stop()
{
/etc/init.d/xfrpc stop
/etc/init.d/xfrpc disable
return 0
}
status()
{
status=$( echo $(pgrep 'xfrpc') | awk ""'{print NF}')
if [ $status = 0 ]; then
status="stopped"
else
status="running"
fi
echo '{ "status" : "'$status'", "msg" : "'$status'" }'
return 0
}
reconfigure()
{
stop
rm -f /etc/xfrpc/xfrpc.ini
cat MORE >> /etc/xfrpc/xfrpc.ini
return 0
}
restart() {
stop
start
}