1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #!/bin/sh
- #
- # Start & stop the inadyn client
- #
- CONFIG=/etc/inadyn.conf
- # check if CONFIG exists, print message & exit if it doesn't
- [ ! -f $CONFIG ] && ( echo "The config file "$CONFIG" is missing...exiting now." && exit 2 )
- # Allow a few customizations from a config file. Especially inadyn
- # must be explicitly enabled by adding ENABLED="yes" in this file.
- test -r /etc/default/inadyn && . /etc/default/inadyn
- case "$1" in
- start)
- printf "Starting inadyn: "
- if test "${ENABLED}" != "yes" ; then
- echo "SKIPPED"
- exit 0
- fi
- start-stop-daemon -b -q -S -p /var/run/inadyn.pid -x /usr/sbin/inadyn
- [ $? = 0 ] && echo "OK" || echo "FAIL"
- ;;
- stop)
- printf "Stopping inadyn: "
- if test "${ENABLED}" != "yes" ; then
- echo "SKIPPED"
- exit 0
- fi
- start-stop-daemon -q -K -p /var/run/inadyn.pid -x /usr/sbin/inadyn
- [ $? = 0 ] && echo "OK" || echo "FAIL"
- rm -f /var/run/inadyn.pid
- ;;
- restart)
- "$0" stop
- "$0" start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- exit 1
- esac
- exit $?
|