This repository was archived by the owner on Aug 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutpost
More file actions
80 lines (70 loc) · 1.26 KB
/
outpost
File metadata and controls
80 lines (70 loc) · 1.26 KB
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
#!/bin/bash
SKYSTACK_HOME=/opt/skystack/
OUT_PID=$SKYSTACK_HOME/run/outpost.pid
EPM_PID=$SKYSTACK_HOME/run/epmd.pid
start() {
if [ ! -e $OUT_PID ]; then
echo "starting: Skystack Outpost"
exec $SKYSTACK_HOME/outpost/latest/start.sh
fi
}
add_pids() {
echo -e `pidof beam` > $OUT_PID
echo -e `pidof epmd` > $EPM_PID
echo "Skystack Outpost running with pid `pidof beam`"
}
stop() {
OPID=`cat $OUT_PID`
echo "stopping: Skystack Outpost with pid `cat $OUT_PID`"
if [ -e $OUT_PID ]; then
kill -9 $OPID
rm $OUT_PID
fi
}
stop_all() {
OPID=`cat $OUT_PID`
EPID=`cat $EPM_PID`
echo "stopping: Skystack Outpost and EPMD with pids `cat $W_PID` ,`cat $E_PID`"
if [ -e $OUT_PID ]; then
kill -9 $OPID
rm $OUT_PID
fi
if [ -e $EPM_PID ]; then
kill -9 $EPID
rm $EPM_PID
fi
}
restart() {
stop
start
}
status() {
if [ -e $OUT_PID ]; then
echo "Skystack Outpost is running with pid `cat $OUT_PID`"
else
echo "Skystack Outpost has not been started. /etc/init.d/outpost start"
fi
}
# See how we were called.
case "$1" in
start)
start
add_pids
;;
stop)
stop
;;
stop_all)
stop_all
;;
restart)
restart
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|stop_all|restart|status}"
exit 1
esac
exit 0