Advertisement
Guest User

tac init

a guest
Apr 10th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.69 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. ### BEGIN INIT INFO
  4. # Provides:          tac-plus
  5. # Required-Start:    $network
  6. # Required-Stop:
  7. # Default-Start:     2 3 4 5
  8. # Default-Stop:      S 0 1 6
  9. # Short-Description: Start tac-plus server.
  10. # Description:       Run the tac-plus server listening for
  11. #                    AAA ( access, acounting and autorization request )
  12. #                    from routers or RAS (remote access servers) via
  13. #                    tacacs+ protocol
  14. ### END INIT INFO
  15.  
  16. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  17. DAEMON=/usr/local/bin/tac_plus
  18. NAME=tac_plus
  19. DESC="Tacacs+ server"
  20. OTHER_OPTS="-d 256"         # Default, if no /etc/default/tac-plus available
  21.  
  22. CONFIG_FILE="/etc/tacacs/tac_plus.conf"    # Default, if no /etc/default/tac-plus available
  23.  
  24. test -f $DAEMON || exit 0
  25. if [ -r /etc/default/tac_plus ] ; then
  26.         . /etc/default/tac_plus
  27. fi
  28. DAEMON_OPTS="-C $CONFIG_FILE $OTHER_OPTS"
  29.  
  30. case "$1" in
  31.  
  32.   start)
  33.         echo -n "Starting $DESC: "
  34.         start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid  --exec $DAEMON -- $DAEMON_OPTS
  35.         echo "$NAME."
  36.         ;;
  37.   stop)
  38.         echo -n "Stopping $DESC: "
  39.         start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON
  40.         echo "$NAME."
  41.         ;;
  42.   restart|force-reload)
  43.         echo -n "Restarting $DESC: "
  44.         start-stop-daemon --stop --quiet --pidfile \
  45.         /var/run/$NAME.pid --exec $DAEMON
  46.         sleep 1
  47.         start-stop-daemon --start --quiet --pidfile \
  48.         /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
  49.         echo "$NAME."
  50.         ;;
  51.   *)
  52.         N=/etc/init.d/$NAME
  53.         echo "Usage: $N {start|stop|restart}" >&2
  54.         exit 1
  55.         ;;
  56. esac
  57. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement