Release bumped to "gts4".
[tac_plus.git] / tac_plus.init
1 #!/bin/sh
2 #
3 # tac_plus        This shell script takes care of starting and stopping
4 #                                tac_plus (TACACS+ daemon).
5 #
6 # chkconfig: 235 80 20
7 # description: tac_plus is TACACS+ daemon.
8 # processname: tac_plus
9 # config: /etc/tacacs/tac_plus.cfg
10 # pidfile: /var/run/tac_plus.pid
11 # debug : 0
12
13 # Source function library.
14 . /etc/rc.d/init.d/functions
15
16 # Source networking configuration.
17 . /etc/sysconfig/network
18
19 # Check that networking is up.
20 [ ${NETWORKING} = "no" ] && exit 0
21
22 # Some config parameters
23 #For config file
24 tacacs_config="/etc/tacacs/tac_plus.cfg"
25 #For debug option
26 debug=0
27
28 [ -f /usr/sbin/tac_plus ] || exit 0
29
30 [ -f $tacacs_config ] || exit 0
31
32
33 # See how we were called.
34 case "$1" in
35   start)
36         # Start daemon.
37         if [ $debug -gt 0 ]
38         then
39         echo -n "Starting TACACS+ with debug level $debug : "
40         daemon tac_plus -C $tacacs_config -d $debug
41         else
42         echo -n "Starting TACACS+ :"
43         daemon tac_plus -C $tacacs_config
44         fi
45         echo
46         touch /var/lock/subsys/tac_plus
47         ;;
48   stop)
49         # Stop daemons.
50         echo -n "Shutting down TACACS+: "
51         killproc tac_plus
52         rm -f /var/lock/subsys/tac_plus
53         echo
54         ;;
55   status)
56         status tac_plus
57         exit $?
58         ;;
59   restart)
60         $0 stop
61         $0 start
62         ;;
63
64   reload)
65         echo "TACACS+ now reloading......"
66         kill -SIGUSR1 `cat /var/run/tac_plus.pid`
67         exit $?
68         ;;
69   test)
70         echo "TACACS+ config being testing..."
71         /usr/sbin/tac_plus -P -C $tacacs_config
72         ;;
73   *)
74         echo "Usage: tac_plus {start|stop|status|restart|reload|test}"
75         exit 1
76 esac
77
78 exit 0