Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ### BEGIN INIT INFO |
| 3 | # Provides: kea-dhcp-ddns-server |
| 4 | # Required-Start: $local_fs $network $remote_fs $syslog |
| 5 | # Required-Stop: $local_fs $network $remote_fs $syslog |
| 6 | # Default-Start: 2 3 4 5 |
| 7 | # Default-Stop: 0 1 6 |
| 8 | # Short-Description: ISC KEA DHCP IPv6 Server |
| 9 | ### END INIT INFO |
| 10 | |
| 11 | PATH=/sbin:/usr/sbin:/bin:/usr/bin |
| 12 | DESC="kea-dhcp-ddns-server" |
| 13 | NAME=kea-dhcp-ddns |
| 14 | DAEMON=/usr/sbin/keactrl |
| 15 | DAEMON_ARGS=" -s dhcp_ddns" |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | # Exit if the package is not installed |
| 20 | [ -x "$DAEMON" ] || exit 0 |
| 21 | |
| 22 | # Source function library. |
| 23 | . /etc/init.d/functions |
| 24 | |
| 25 | case "$1" in |
| 26 | start) |
| 27 | echo -n "Starting $DESC: " |
| 28 | start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS |
| 29 | echo "done." |
| 30 | ;; |
| 31 | stop) |
| 32 | echo -n "Stopping $DESC: " |
| 33 | kpid=`pidof $NAME` |
| 34 | kill $kpid |
| 35 | echo "done." |
| 36 | ;; |
| 37 | restart|force-reload) |
| 38 | # |
| 39 | $0 stop |
| 40 | $0 start |
| 41 | ;; |
| 42 | *) |
| 43 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 |
| 44 | exit 1 |
| 45 | ;; |
| 46 | esac |