S70inadyn 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. #
  3. # Start & stop the inadyn client
  4. #
  5. CONFIG=/etc/inadyn.conf
  6. # check if CONFIG exists, print message & exit if it doesn't
  7. [ ! -f $CONFIG ] && ( echo "The config file "$CONFIG" is missing...exiting now." && exit 2 )
  8. # Allow a few customizations from a config file. Especially inadyn
  9. # must be explicitly enabled by adding ENABLED="yes" in this file.
  10. test -r /etc/default/inadyn && . /etc/default/inadyn
  11. case "$1" in
  12. start)
  13. printf "Starting inadyn: "
  14. if test "${ENABLED}" != "yes" ; then
  15. echo "SKIPPED"
  16. exit 0
  17. fi
  18. start-stop-daemon -b -q -S -p /var/run/inadyn.pid -x /usr/sbin/inadyn
  19. [ $? = 0 ] && echo "OK" || echo "FAIL"
  20. ;;
  21. stop)
  22. printf "Stopping inadyn: "
  23. if test "${ENABLED}" != "yes" ; then
  24. echo "SKIPPED"
  25. exit 0
  26. fi
  27. start-stop-daemon -q -K -p /var/run/inadyn.pid -x /usr/sbin/inadyn
  28. [ $? = 0 ] && echo "OK" || echo "FAIL"
  29. rm -f /var/run/inadyn.pid
  30. ;;
  31. restart)
  32. "$0" stop
  33. "$0" start
  34. ;;
  35. *)
  36. echo "Usage: $0 {start|stop|restart}"
  37. exit 1
  38. esac
  39. exit $?