#! /bin/sh  

case "$1" in
  start)
    echo "start wdtd ...."
	start-stop-daemon -q -S -x /opt/ocpp/enwdt &
    ;;
  stop)
    echo "stop wdtd ...."
	start-stop-daemon -q -K -x /opt/ocpp/enwdt &
    ;;
  restart)
	echo "restart wdtd ...."
	start-stop-daemon -q -K -x /opt/ocpp/enwdt &
	start-stop-daemon -q -S -x /opt/ocpp/enwdt &
    ;;
  *)
    echo "Usage: /etc/init.d/S79wdtd {start|stop|restart}"
    exit 1
esac

if [ -f /opt/wifi/wifi_en ]; then
    /opt/wifi/wifi_set.sh
fi

exit 0
