-
Notifications
You must be signed in to change notification settings - Fork 1
/
ehcp
executable file
·64 lines (46 loc) · 1.1 KB
/
ehcp
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
#!/bin/bash
# ehcp (Easy Hosting Control Panel) start/stop script
# www.ehcp.net
echo
echo
show_ehcp(){
ps aux | grep ehcpdaemon2 | grep -v grep
ps aux | grep "index.php daemon" | grep -v grep
ps aux | grep "ehcp_daemon.py" | grep -v grep
}
ehcp_start(){
echo "starting ehcp.."
echo "starting ehcp_daemon.py"
nohup /etc/init.d/ehcp_daemon.py >> /var/log/ehcp.log 2>&1 &
cd /var/www/new/ehcp
./ehcpdaemon.sh
show_ehcp
}
ehcp_stop(){
echo "stopping ehcp.."
echo "stopping ehcpdaemon2.sh"
ps aux | grep ehcpdaemon2 | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
echo "stopping index.php daemon"
ps aux | grep "index.php daemon" | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
echo "stopping ehcp_daemon.py, python background server process"
ps aux | grep ehcp_daemon.py | grep -v grep | awk '{print $2}' | xargs kill > /dev/null 2>&1
show_ehcp
}
case $1 in
start)
ehcp_start
;;
stop)
ehcp_stop
;;
restart)
ehcp_stop
ehcp_start
;;
status)
show_ehcp
;;
*)
echo "Usage: /etc/init.d/ehcp {start|stop|restart|status}"
;;
esac