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.

45 lines
1.1 KiB

  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. pid=$(pidof dcwapd)
  15. if [ -n "$pid" ]; then
  16. if [ "$verbose" -eq "1" ]; then
  17. echo "Stopping dcwapd..." 2>&1 | logger
  18. fi
  19. kill "$pid"
  20. fi
  21. get_channelsets
  22. # get the list of channel sets
  23. channelsets=$result
  24. for channelset in $channelsets; do
  25. if [ -n "$channelset" ]; then
  26. # we don't care if it is enabled, tear it down
  27. # get_channelset_enabled $channelset
  28. # enabled=$result
  29. # if [ $enabled = "1" ]; then
  30. # # the channel set is enabled
  31. # get the list of data channels used by the channel set
  32. get_datachannels "$channelset"
  33. datachannels=$result
  34. for datachannel in $datachannels; do
  35. datachannel_down "$datachannel"
  36. done
  37. # fi
  38. fi
  39. done