3
# Provides: wide-dhcpv6-relay
4
# Required-Start: $syslog $network $remote_fs
5
# Required-Stop: $syslog $remote_fs
6
# Should-Start: $local_fs
7
# Should-Stop: $local_fs
8
# Default-Start: 2 3 4 5
10
# Short-Description: Start/Stop WIDE DHCPv6 relay agent
11
# Description: (empty)
14
PATH=/sbin:/bin:/usr/sbin:/usr/bin
15
DHCP6RBIN=/usr/sbin/dhcp6relay
16
DHCP6RPID=/var/run/dhcp6relay.pid
18
DESC="WIDE DHCPv6 relay"
20
. /lib/lsb/init-functions
22
test -x $DHCP6RBIN || exit 0
24
if [ ! -f /etc/default/wide-dhcpv6-relay ]; then
27
. /etc/default/wide-dhcpv6-relay
31
[ "X$INTERFACES" != "X" ] || exit 0
33
# single arg is -v for messages, -q for none
36
if [ ! -r "$DHCP6RPID" ]; then
37
test "$1" != -v || echo "$NAME is not running."
40
if read pid < "$DHCP6RPID" && ps -p "$pid" > /dev/null 2>&1; then
41
test "$1" != -v || echo "$NAME is running."
44
test "$1" != -v || echo "$NAME is not running but $DHCP6RPID exists."
51
log_daemon_msg "Starting $DESC" "$NAME"
52
start-stop-daemon --start --quiet --pidfile $DHCP6RPID \
53
--oknodo --exec $DHCP6RBIN -- $INTERFACES
55
if check_status -q; then
63
log_daemon_msg "Stopping $DESC" "$NAME"
64
start-stop-daemon --stop --quiet --pidfile $DHCP6RPID --oknodo
72
if [ "$?" != "0" ]; then
77
echo "Status of $NAME: "
82
echo "Usage: $0 (start|stop|restart|force-reload|status)"