Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
tacacs+
> tac_plus.init.rh
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File tac_plus.init.rh of Package tacacs+ (Revision 21)
Currently displaying revision
21
,
show latest
#!/bin/bash # # /etc/rc.d/init.d/tac_plus # # chkconfig: 2345 86 14 # description: TACACS+ Daemon # Define variables TACPLUS_PID=/var/run/tac_plus.pid TACPLUS_EXE=/usr/bin/tac_plus TACPLUS_OPTS="" TACPLUS_CNF=/etc/tac_plus.conf TACPLUS_SYSCONFIG=/etc/sysconfig/tac_plus test -r $TACPLUS_SYSCONFIG || exit 6 . $TACPLUS_SYSCONFIG # Source function library. . /etc/rc.d/init.d/functions case "$1" in start) # Check to see if tac_plus is running. if [ -n "`pidof tac_plus`" ] ; then echo "tac_plus is already running!" exit 1 elif [ -f ${TACPLUS_PID} ] || [ -f /var/lock/subsys/tac_plus ]; then echo "tac_plus may already be running. Check for existing tac_plus processes." echo "if tac_plus is not running, remove ${TACPLUS_PID} and /var/lock/subsys/tac_plus" exit 1 else echo -n "Starting tac_plus:" $TACPLUS_EXE $TACPLUS_OPTS -C $TACPLUS_CNF && success || failure echo touch /var/lock/subsys/tac_plus fi ;; stop) if [ -f ${TACPLUS_PID} ] && [ -f /var/lock/subsys/tac_plus ]; then echo -n "Stopping tac_plus:" killproc -p ${TACPLUS_PID} echo rm -f /var/lock/subsys/tac_plus rm -f ${TACPLUS_PID} elif [ -n "`pidof tac_plus`" ] ; then echo -n "Stopping tac_plus:" kill -9 `pidof tac_plus` echo else echo "tac_plus does not appear to be running." fi ;; status) if [ -f ${TACPLUS_PID} ] && [ -f /var/lock/subsys/tac_plus ]; then echo "tac_plus pid is `cat ${TACPLUS_PID}`" else echo "tac_plus does not appear to be running." fi ;; restart) $0 stop; $0 start ;; reload) echo -n "Reloading tac_plus..." if [ -f ${TACPLUS_PID} ] && [ -f /var/lock/subsys/tac_plus ]; then kill -HUP `cat ${TACPLUS_PID}` RETVAL=$? fi if [ $RETVAL -ne 0 ]; then failure else success fi echo ;; *) echo "Usage: $0 {start|stop|status|reload|restart}" exit 1 ;; esac