A small, lightweight and extensible DynDNS server written with Ruby and Rack.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
1.3 KiB

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: dyndnsd
  4. # Required-Start: $remote_fs $syslog
  5. # Required-Stop: $remote_fs $syslog
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Handle dyndnsd.rb gem
  9. ### END INIT INFO
  10. # using the system ruby's gem binaries directory
  11. DAEMON="/var/lib/gems/1.8/bin/dyndnsd"
  12. CONFIG_FILE="/opt/dyndnsd/config.yaml"
  13. DAEMON_OPTS="$CONFIG_FILE"
  14. test -x $DAEMON || exit 0
  15. . /lib/lsb/init-functions
  16. case "$1" in
  17. start)
  18. log_daemon_msg "Starting dyndnsd.rb" "dyndnsd"
  19. start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile "/var/run/dyndnsd.pid" --background --exec $DAEMON -- $DAEMON_OPTS
  20. log_end_msg $?
  21. ;;
  22. stop)
  23. log_daemon_msg "Stopping dyndnsd.rb" "dyndnsd"
  24. start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/dyndnsd.pid"
  25. log_end_msg $?
  26. ;;
  27. restart|force-reload)
  28. log_daemon_msg "Restarting dyndnsd.rb" "dyndnsd"
  29. start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile "/var/run/dyndsd.pid"
  30. start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile "/var/run/dyndnsd.pid" --background --exec $DAEMON -- $DAEMON_OPTS
  31. log_end_msg $?
  32. ;;
  33. *)
  34. log_action_msg "Usage: $0 {start|stop|restart|force-reload}"
  35. exit 2
  36. ;;
  37. esac