updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / bacula-sqlite / bacula-sd
blobf110c994494697b5758f4a959a5bce77d2f1d90b
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 BACULA_SD_BIN=/usr/sbin/bacula-sd
7 BACULA_SD_CONF=/etc/bacula/bacula-sd.conf
8 BACULA_SD_PID=`pidof -o %PPID $BACULA_SD_BIN`
9 BACULA_SD_PIDFILE="var/run/bacula-sd.[0-9]*.pid"
10 BACULA_SD_PID=$(cat $BACULA_SD_PIDFILE 2>/dev/null)
13 case "$1" in
14 start)
15 stat_busy "Starting Bacula Storage Daemon"
16 [ -z "$BACULA_SD_PID" ] && $BACULA_SD_BIN -c $BACULA_SD_CONF
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon bacula-sd
21 stat_done
24 stop)
25 stat_busy "Stopping Bacula Storage Daemon"
26 [ ! -z "$BACULA_SD_$PID" ] && kill $BACULA_SD_PID &>/dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm -f /var/run/bacula-sd.pid
31 rm_daemon bacula-sd
32 stat_done
35 restart)
36 $0 stop
37 sleep 1
38 $0 start
41 echo "usage: $0 {start|stop|restart}"
42 esac
43 exit 0