]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/bacula.in
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / scripts / bacula.in
1 #! /bin/sh
2 #
3 # bacula       This shell script takes care of starting and stopping
4 #              the bacula daemons.
5 #
6 #   This is pretty much watered down version of the RedHat script
7 #   that works on Solaris as well as Linux, but it won't work everywhere.
8 #
9 # description: It comes by night and sucks the vital essence from your computers.
10 #
11
12 # All these are not *really* needed but it makes it
13 #  easier to "steal" this code for the development 
14 #  environment where they are different.
15 #  
16 BACFDCFG=@sysconfdir@
17 BACSDCFG=@sysconfdir@
18 BACDIRCFG=@sysconfdir@
19
20 case "$1" in
21    start)
22       [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2
23       [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2
24       [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2
25       ;;
26
27    stop)
28       # Stop the FD first so that SD will fail jobs and update catalog
29       [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2
30       [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2
31       [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2
32       echo
33       sleep 6
34       ;;
35
36    restart)
37       $0 stop
38       $0 start
39       ;;
40
41    status)
42       [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd status
43       [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd status
44       [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir status
45       ;;
46
47    *)
48       echo "Usage: $0 {start|stop|restart|status}"
49       exit 1
50       ;;
51 esac
52 exit 0