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