#!/bin/bash # chkconfig: 3 99 1 # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Some config parameters #For config file tacacs_config="/etc/tacacs.conf" tacacs_log="/var/log/tac_plus/tac_plus.log" #For debug option debug=0 [ -f /usr/local/bin/tac_plus ] || exit 0 [ -f $tacacs_config ] || exit 0 # See how we were called. case "$1" in start) # Start daemon. if [ $debug -gt 0 ] then echo -n "Starting TACACS+ with debug level $debug : " daemon /usr/local/bin/tac_plus -C $tacacs_config -d $debug -l $tacacs_log else echo -n "Starting TACACS+ :" daemon /usr/local/bin/tac_plus -C $tacacs_config -l $tacacs_log fi echo touch /var/lock/subsys/tac_plus ;; stop) # Stop daemons. echo -n "Shutting down TACACS+: " killproc tac_plus rm -f /var/lock/subsys/tac_plus echo ;; status) status tac_plus exit $? ;; restart) $0 stop $0 start ;; reload) echo "TACACS+ now reloading......" kill -SIGUSR1 `cat /var/run/tac_plus.pid` exit $? ;; test) echo "TACACS+ config being testing..." /usr/local/bin/tac_plus -P -C $tacacs_config ;; *) echo "Usage: tac_plus {start|stop|status|restart|reload|test}" exit 1 esac exit 0