Advertisement
Guest User

dibbler-client daemon script

a guest
Jul 28th, 2014
2,104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.56 KB | None | 0 0
  1. #! /bin/sh
  2. #
  3. # Starts/stops dibbler-client
  4. #
  5. ### BEGIN INIT INFO
  6. # Provides:          dibbler-client
  7. # Required-Start:    $network $remote_fs
  8. # Required-Stop:     $network $remote_fs
  9. # Should-Start:      $local_fs
  10. # Should-Stop:       $local_fs
  11. # Default-Start:     2 3 4 5
  12. # Default-Stop:      0 1 6
  13. # Short-Description: Starts DHCPv6 client
  14. # Description:       By starting dibbler-client, this host
  15. #                    will try to obtain IPv6 address and other
  16. #                    configuration parameters from DHCPv6 server.
  17. ### END INIT INFO
  18. #
  19. #               Based on a script written by Miquel van Smoorenburg <miquels@cistron.nl>.
  20. #               Modified for Debian by Ian Murdock <imurdock@gnu.ai.mit.edu>.
  21. #
  22. # Version:      2007-06-12 Tomasz Mrugalski <thomson@klub.com.pl>
  23. #
  24.  
  25. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  26. DAEMON=/usr/local/sbin/dibbler-client
  27. NAME=dibbler-client
  28. DESC="DHCPv6 client"
  29. DAEMON_OPTS=run
  30.  
  31. test -x $DAEMON || exit 0
  32.  
  33. # Include dibbler defaults if available
  34. if [ -f /etc/default/dibbler ] ; then
  35.         . /etc/default/dibbler
  36. fi
  37.  
  38. set -e
  39.  
  40. case "$1" in
  41.   start)
  42.         echo -n "Starting $DESC: "
  43.         $DAEMON start 2>&1 > /dev/null
  44.         echo "$NAME."
  45.         ;;
  46.   stop)
  47.         echo -n "Stopping $DESC: "
  48.         ($DAEMON stop 2>&1 > /dev/null || true)
  49.         echo "$NAME."
  50.         ;;
  51.   status)
  52.         echo "Status $DESC: $NAME"
  53.         $DAEMON status
  54.         ;;
  55.   #reload)
  56.         #
  57.         #       If the daemon can reload its config files on the fly
  58.         #       for example by sending it SIGHUP, do it here.
  59.         #
  60.         #       If the daemon responds to changes in its config file
  61.         #       directly anyway, make this a do-nothing entry.
  62.         #
  63.         # echo "Reloading $DESC configuration files."
  64.         # start-stop-daemon --stop --signal 1 --quiet --pidfile \
  65.         #       /var/run/$NAME.pid --exec $DAEMON
  66.   #;;
  67.   restart|force-reload)
  68.         #
  69.         #       If the "reload" option is implemented, move the "force-reload"
  70.         #       option to the "reload" entry above. If not, "force-reload" is
  71.         #       just the same as "restart".
  72.         #
  73.         echo -n "Restarting $DESC: "
  74.         ($DAEMON stop 2>&1 > /dev/null || true)
  75.         sleep 1
  76.         $DAEMON start 2>&1 > /dev/null
  77.         echo "$NAME."
  78.         ;;
  79.   *)
  80.         N=/etc/init.d/$NAME
  81.         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
  82.         echo "Usage: $N {start|stop|restart|force-reload}" >&2
  83.         exit 1
  84.         ;;
  85. esac
  86.  
  87. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement