You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
664 B

  1. #!/bin/sh /etc/rc.common
  2. START=99
  3. # Setting the stop value makes the restart script unreliable when invoked by LuCI
  4. #STOP=0
  5. scriptdir=/etc/dcwapd
  6. #validate_section_dcwapd() {
  7. # uci_validate_section dcwapd general "${1}" \
  8. # 'enabled:bool:1'
  9. #}
  10. start() {
  11. # validate_section_dcwapd dcwapd
  12. # only run the start script if the enabled uci option is set properly
  13. enabled=$(uci get dcwapd.general.enabled)
  14. if [ "${enabled}" = "1" ]; then
  15. ${scriptdir}/start_dcwapd.sh
  16. else
  17. echo "dcwapd is disabled in UCI"
  18. return 1
  19. fi
  20. }
  21. stop() {
  22. ${scriptdir}/stop_dcwapd.sh
  23. # Add a sleep after stopping because an immediate restat will fail otherwise
  24. sleep 1
  25. }