-
Notifications
You must be signed in to change notification settings - Fork 1
/
fakebidderctl
69 lines (60 loc) · 1.24 KB
/
fakebidderctl
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
#!/bin/bash
# $Id: $
# Fakebidder control script
# Usage: fakebidderctl start|stop|status
CONF=/etc/fakebidder/conf/supervisord.conf
supervisord -c $CONF
fakebidder_start () {
#####supervisord -c /etc/fakebidder/conf/supervisord.conf
FAKEBIDDER=$1
if [ $FAKEBIDDER == "all" ]; then
echo "Starting all fakebidders"
supervisorctl -c $CONF start all
else
echo "Starting only $FAKEBIDDER"
supervisorctl -c $CONF start $FAKEBIDDER
fi
}
fakebidder_stop () {
FAKEBIDDER=$1
if [ $FAKEBIDDER == "all" ]; then
echo "Stopping all fakebidders"
supervisorctl -c $CONF stop all
else
echo "Stopping only $FAKEBIDDER"
supervisorctl -c $CONF stop $FAKEBIDDER
fi
}
fakebidder_restart () {
fakebidder_stop "$@"
fakebidder_start "$@"
}
cmd="$1"
shift
case "$cmd" in
start)
fakebidder_start "$@"
exit $?
;;
stop)
echo $@
fakebidder_stop "$@"
exit $?
;;
restart)
fakebidder_stop "$@"
fakebidder_start "$@"
exit $?
;;
status)
fakebidder_status
exit $?
;;
clean)
fakebidder_clean
exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|status|clean} [args]"
echo 1
esac