]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/solaris/bacula-dir.in
Update release date
[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 # description: The Leading Open Source Backup Solution.
7 #
8 # For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
9 #
10
11 DIR_USER=@dir_user@
12 DIR_GROUP=@dir_group@
13 DIR_OPTIONS=''
14
15 case "$1" in
16     start)
17        if [ ! -z "${DIR_USER}" ]; then
18           [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-u ${DIR_USER}" || \
19                                      DIR_OPTIONS="${DIR_OPTIONS} -u ${DIR_USER}"
20        fi
21        if [ ! -z "${DIR_GROUP}" ]; then
22           [ -z "${DIR_OPTIONS}" ] && DIR_OPTIONS="-g ${DIR_GROUP}" || \
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        if [ -x /usr/bin/zonename ]; then
32           case `/usr/bin/zonename` in
33              global)
34                 pkill -z global -x bacula-dir
35                 ;;
36              *)
37                 pkill -x bacula-dir
38                 ;;
39           esac
40        else
41           pkill -x bacula-dir
42        fi
43        ;;
44     restart)
45        $0 stop
46        sleep 5
47        $0 start
48        ;;
49     *)
50        echo "Usage: $0 {start|stop|restart}"
51        exit 1
52        ;;
53 esac
54 exit 0