-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdown
executable file
·65 lines (62 loc) · 1.37 KB
/
down
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/bash
if [ -e lola.pid ]
then
EMUD=`cat lola.pid`;
else
if [ "$1" != "-tail" ]
then
echo "Cannot find the pid of current_lola.";
exit;
fi
fi
if [ -e script.pid ]
then
SCRIPT=`cat script.pid`;
else
echo "Cannot determine the pid of the lola-script.";
fi
case $1 in
-lola)
echo "Sending Lola-process ${EMUD} and ${SCRIPT} the TERM signal..."
kill -TERM $EMUD;
killall -TERM tail 1>/dev/null 2>/dev/null;
kill -TERM $SCRIPT
sleep 3;
echo "Send all Lola-process the KILL signal..."
kill -KILL $EMUD 1>/dev/null 2>/dev/null;
killall -KILL tail 1>/dev/null 2>/dev/null;
killl -KILL $SCRIPT 1>/dev/null 2>/dev/null;
echo "OK"
;;
-current_lola)
killall -TERM $EMUD;
sleep 2;
killall -KILL $EMUD 1>/dev/null 2>/dev/null;
;;
*)
echo "Sending Lola-processes $EMUD and $SCRIPT the TERM signal..."
kill -TERM $EMUD;
killall -TERM tail 1>/dev/null 2>/dev/null;
kill -TERM $SCRIPT;
sleep 3
echo "Sending all Lola-processes the KILL signal..."
kill -KILL $EMUD 1>/dev/null 2>/dev/null;
killall -KILL tail 1>/dev/null 2>/dev/null;
kill -KILL $SCRIPT 1>/dev/null 2>/dev/null;
if [ -e ./RUNNING ]
then
echo "Removing the RUNNING file...";
rm RUNNING;
fi
if [ -e ./lola.pid ]
then
echo "Removing lola.pid...";
rm lola.pid;
fi
if [ -e ./script.pid ]
then
echo "Removing script.pid...";
rm script.pid;
fi
;;
esac