#!/bin/bash # # tacacs This shell script takes care of starting and stopping # tac_plus (TACACS+ Server). # # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Source tacacs configuration. . /etc/sysconfig/tacacs # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /usr/local/sbin/tac_plus ] || exit 0 [ -f /etc/tacacs.conf ] || exit 0 RETVAL=0 prog="tacacs" start() { # Start daemons. echo -n $"Starting $prog: " daemon tac_plus -n ${OPTIONS} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tac_plus echo return $RETVAL } stop() { # Stop daemons. echo -n $"Stopping $prog: " killproc tac_plus RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tac_plus echo return $RETVAL } reload() { /usr/bin/killall -USR1 tac_plus return $? } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; *) echo $"Usage: $0 {start|stop|reload}" exit 1 esac exit $?