S09dnsmasq 659 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:
  4. # Short-Description: Start daemon at boot time
  5. # Description: Enable service provided by daemon.
  6. ### END INIT INFO
  7. . /opt/wz_mini/wz_mini.conf
  8. . /opt/wz_mini/etc/rc.common
  9. dnsmasq_launch() {
  10. wait_for_wlan_ip
  11. echo "#####$(basename "$0")#####"
  12. if [[ "$ENABLE_LOCAL_DNS" == "true" ]]; then
  13. dnsmasq -C /opt/wz_mini/etc/dnsmasq.conf
  14. rm -f /tmp/resolv.conf
  15. cp /opt/wz_mini/etc/resolv.conf /tmp/resolv.conf
  16. echo "dnsmasq enabled"
  17. fi
  18. }
  19. case "$1" in
  20. start)
  21. dnsmasq_launch &
  22. ;;
  23. stop)
  24. pkill dnsmasq
  25. ;;
  26. restart)
  27. $0 stop
  28. $0 start
  29. ;;
  30. *)
  31. echo "Usage: $0 {start|stop}"
  32. exit 1
  33. ;;
  34. esac