Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- ### BEGIN INIT INFO
- # Provides: tac-plus
- # Required-Start: $network
- # Required-Stop:
- # Default-Start: 2 3 4 5
- # Default-Stop: S 0 1 6
- # Short-Description: Start tac-plus server.
- # Description: Run the tac-plus server listening for
- # AAA ( access, acounting and autorization request )
- # from routers or RAS (remote access servers) via
- # tacacs+ protocol
- ### END INIT INFO
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- DAEMON=/usr/local/bin/tac_plus
- NAME=tac_plus
- DESC="Tacacs+ server"
- OTHER_OPTS="-d 256" # Default, if no /etc/default/tac-plus available
- CONFIG_FILE="/etc/tacacs/tac_plus.conf" # Default, if no /etc/default/tac-plus available
- test -f $DAEMON || exit 0
- if [ -r /etc/default/tac_plus ] ; then
- . /etc/default/tac_plus
- fi
- DAEMON_OPTS="-C $CONFIG_FILE $OTHER_OPTS"
- case "$1" in
- start)
- echo -n "Starting $DESC: "
- start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON
- sleep 1
- start-stop-daemon --start --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
- echo "$NAME."
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart}" >&2
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement