#! /bin/sh
# Set ENABLED=0 to disable, ENABLED=1 to enable.
ENABLED=0

DAEMON=/usr/sbin/netplan
PATH=/bin:/usr/bin:/sbin:/usr/sbin

test -f $DAEMON || exit 0

if [ "$ENABLED" = 0 ]
then
#    echo "/etc/init.d/plan: netplan daemon not enabled"
    exit 0
fi

case "$1" in
  start)
    echo -n "Starting plan appointment daemon: netplan"
    start-stop-daemon --start --quiet --exec $DAEMON
    echo "."
    ;;
  stop)
    echo -n "Stopping plan appointment daemon: netplan"
    start-stop-daemon --stop --quiet --exec $DAEMON
    echo "."
    ;;
  restart | force-reload)
    echo -n "Stopping plan appointment daemon: netplan"
    start-stop-daemon --stop --quiet --exec $DAEMON
    echo "."
    echo -n "Restarting plan appointment daemon: netplan"
    start-stop-daemon --start --quiet --exec $DAEMON
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/plan {start|stop|restart|force-reload}"
    exit 1
    ;;
esac
exit 0
