forked from openafs-contrib/afsbotcfg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildbot.sh
executable file
·57 lines (54 loc) · 1.32 KB
/
buildbot.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
TOPDIR=$HOME/buildbot
VENV=$TOPDIR/venv-1.8.1
BUILDBOT=$VENV/bin/buildbot
MASTER=$TOPDIR/master
BOS=$HOME/openafs/bin/bos
BOSSERVER=$HOME/openafs/sbin/bosserver
PIDFILES=$HOME/openafs/var/openafs
BOSSERVER_RUNNING=
# Check the pidfile to see if the bosserver
# is already running.
check_bosserver() {
if [ ! -f $PIDFILES/bosserver.pid ]; then
BOSSERVER_RUNNING="no"
else
pid0=`cat $PIDFILES/bosserver.pid`
pid1=`pidof bosserver`
if [ "x$pid0" != "x$pid1" ]; then
BOSSERVER_RUNNING="no"
else
BOSSERVER_RUNNING="yes"
fi
fi
}
case "$1" in
init)
check_bosserver
if [ "$BOSSERVER_RUNNING" = "yes" ]; then
echo "bosserver is already running."
else
echo "starting bosserver."
$BOSSERVER -pidfiles -user
fi
;;
start)
$BOS start localhost buildbot -localauth
;;
stop)
$BOS stop localhost buildbot -localauth
;;
restart)
$BOS restart localhost buildbot -localauth
;;
status)
$BOS status localhost -localauth
;;
checkconfig)
echo 'checking config'
$BUILDBOT checkconfig $MASTER
;;
*)
echo "usage: buildbot.sh init|start|stop|restart|status|checkconfig"
;;
esac