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.

39 lines
988 B

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