]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/bacula.in
8a4f91eb4cc2744d4eb075e064ce1ca354a61607
[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 SCRIPTDIR=@scriptdir@
17
18 case "$1" in
19    start)
20       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
21       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
22       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
23       ;;
24
25    stop)
26       # Stop the FD first so that SD will fail jobs and update catalog
27       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
28       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
29       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
30       ;;
31
32    restart)
33       $0 stop
34       sleep 2
35       $0 start
36       ;;
37
38    status)
39       [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status
40       [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status
41       [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status
42       ;;
43
44    *)
45       echo "Usage: $0 {start|stop|restart|status}"
46       exit 1
47       ;;
48 esac
49 exit 0