dcwifi: Add Dual Channel Wi-Fi component packages
[feed/packages.git] / net / dcwifi / dcwapd / files / start_dcwapd.sh
1 #!/bin/sh
2
3 #
4 # Dual Channel Wi-Fi Startup Script
5 #
6 # This script creates the proper network bridge configuration
7 # necessary for Dual Channel Wi-Fi, and starts the dcwapd daemon
8 #
9
10 # Note - shellcheck cannot deal with the dynamic sourcing
11 # shellcheck disable=SC1090
12 # which also messes with variables defined in the sourced file
13 # shellcheck disable=SC2154
14 scriptdir=$(dirname -- "$(readlink -f -- "$0")")
15 . "$scriptdir"/dcwapd.inc
16
17 get_channelsets
18 # get the list of channel sets
19 channelsets=$result
20
21 for channelset in $channelsets; do
22 if [ -n "$channelset" ]; then
23 get_channelset_enabled "$channelset"
24 enabled=$result
25 if [ "$enabled" = "1" ]; then
26 # the channel set is enabled
27
28 # get the list of data channels used by the channel set
29 get_datachannels "$channelset"
30 datachannels=$result
31 for datachannel in $datachannels; do
32 datachannel_up "$datachannel"
33 done
34 fi
35 fi
36 done
37
38 # start dcwapd, sending stdout and stderr to the system log
39 dcwapd 2>&1 | logger &