Newer
Older
Yann Garcia
committed
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
#!/bin/sh -e
DESC="AdvantEDGE platform"
TIMEOUT=7
IS_RUNNING=`kubectl get pods --all-namespaces | grep "meep-virt-engine" | awk '{print $2}'`
start_advantedge() {
if [ -z $IS_RUNNING ] ; then
meepctl deploy dep
sleep $TIMEOUT
meepctl deploy core
sleep $TIMEOUT
kubectl get pods --all-namespaces
fi
}
stop_advantedge() {
if [ -n $IS_RUNNING ]; then
meepctl delete core
sleep $TIMEOUT
meepctl delete dep
sleep $TIMEOUT
kubectl get pods --all-namespaces
fi
IS_RUNNING=`kubectl get pods --all-namespaces | grep "meep-virt-engine" | awk '{print $2}'`
}
case "$1" in
start)
echo "Starting $DESC"
start_advantedge
;;
stop)
echo "Stoping $DESC"
stop_advantedge
;;
restart)
echo "Reloading $DESC"
stop_advantedge
sleep $TIMEOUT
start_advantedge
;;
status)
kubectl get pods --all-namespaces
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0