updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / bacula-sqlite / bacula-dir
blobb743848938a345b45b9af4f90f465e3f10dd1950
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 BACULA_DIR_BIN=/usr/sbin/bacula-dir
7 BACULA_DIR_CONF=/etc/bacula/bacula-dir.conf
8 BACULA_DIR_PIDFILE="var/run/bacula-dir.[0-9]*.pid"
9 BACULA_DIR_PID=$(cat $BACULA_DIR_PIDFILE 2>/dev/null)
11 case "$1" in
12 start)
13 stat_busy "Starting Bacula Director Daemon"
14 [ -z "$BACULA_DIR_PID" ] && $BACULA_DIR_BIN -c $BACULA_DIR_CONF
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon bacula-dir
19 stat_done
22 stop)
23 stat_busy "Stopping Bacula Director Daemon"
24 [ ! -z "$BACULA_DIR_PID" ] && kill $BACULA_DIR_PID &>/dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm -f /var/run/$BACULA_DIR_PIDFILE
29 rm_daemon bacula-dir
30 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0