#!/bin/sh

case $1 in
 start)
  [ -d /var/log ] || mkdir -p /var/log
  [ -d /var/run/dhcp-wfd ] || mkdir -p /var/run/dhcp-fwd
  dhcp-fwd
  ;;
 stop)
  [ -f /var/run/dhcpd-fwd.pid ] && kill $(cat /var/run/dhcpd-fwd.pid) 2>/dev/null
  ;;
 *)
  echo "usage: $0 (start|stop)"
  exit 1
esac

exit $?
