-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathstop.sh
executable file
·41 lines (29 loc) · 854 Bytes
/
stop.sh
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
#!/bin/bash
workspace=$(cd `dirname $0`; pwd)
# Stop polling
PID_poll=`ps -ef | grep PollManager.py | grep -v grep | awk '{print $2}'`
if [ -n "$PID_poll" ]
then
python ${workspace}/PollManager.py stop
fi
sleep 1
# Stop HttpServer
ps -ef | grep HttpServer.py | grep -v grep | awk '{print $ 2}' | xargs kill
# remove check task from /etc/cron.d
cron_procagent="/etc/cron.d/procagent"
if [ -f "$cron_procagent" ]; then
rm ${cron_procagent}
/etc/init.d/cron restart
echo "Remove crontab done"
fi
if [ -f "/tmp/httpsvr.log" ]; then
rm /tmp/httpsvr.log
fi
if [ -f "/etc/rc.d/rc.local" ]; then
sed -i "/procagent/d" /etc/rc.d/rc.local
echo "Remove task from /etc/rc.d/rc.local"
elif [ -f "/etc/rc.local" ]; then
sed -i "/procagent/d" /etc/rc.local
echo "Remove task from /etc/rc.local"
fi
echo "Terminate all"