]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/solaris/bacula-dir.in
c5a3a93c32f3b25df50c87b5a706c6d31362e909
[bacula/bacula] / bacula / platforms / solaris / bacula-dir.in
1 #! /bin/sh
2 #
3 # bacula       This shell script takes care of starting and stopping
4 #              the bacula Director daemon
5 #
6 # chkconfig: 2345 92 9
7 # description: The Leading Open Source Backup Solution.
8 #
9 #  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
10 #
11
12 DIR_USER=@dir_user@
13 DIR_GROUP=@dir_group@
14 DIR_OPTIONS=''
15
16 RETVAL=0
17 case "$1" in
18     start)
19        if [ "${DIR_USER}" != '' ]; then
20           DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}"
21        fi
22        if [ "${DIR_GROUP}" != '' ]; then
23           DIR_OPTIONS="${DIR_OPTIONS} -g ${DIR_GROUP}"
24        fi
25
26        echo "Starting the Bacula Director: "
27        @sbindir@/bacula-dir $2 ${DIR_OPTIONS} -c @sysconfdir@/bacula-dir.conf
28        ;;
29     stop)
30        echo "Stopping the Director daemon: "
31        pkill -x bacula-dir
32        ;;
33     restart)
34        $0 stop
35        sleep 5
36        $0 start
37        ;;
38     *)
39        echo "Usage: $0 {start|stop|restart}"
40        exit 1
41        ;;
42 esac
43 exit 0