summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/kea/files/kea-dhcp4-server
blob: e83e51025d52e574279a114122ff76a1669bf587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
### BEGIN INIT INFO
# Provides:          kea-dhcp4-server
# Required-Start:    $local_fs $network $remote_fs $syslog
# Required-Stop:     $local_fs $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ISC KEA DHCP IPv6 Server
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="kea-dhcp4-server"
NAME=kea-dhcp4
DAEMON=/usr/sbin/keactrl
DAEMON_ARGS=" -s dhcp4"

set -e

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Source function library.
. /etc/init.d/functions

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon -S -b -n $NAME -x $DAEMON -- start $DAEMON_ARGS
        echo "done."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        kpid=`pidof $NAME`
        kill $kpid
        echo "done."
        ;;
  restart|force-reload)
        #
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac