40-wireless-config-hwmode-fix 480 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. FIX_SCRIPT=" \
  3. require('os') \
  4. local uci = require('luci.model.uci').cursor() \
  5. function change_mode(t) \
  6. if t['hwmode'] == '11na' then \
  7. curs:set('wireless', t['.name'], 'hwmode', '11a') \
  8. elseif t['hwmode'] == '11ng' then \
  9. curs:set('wireless', t['.name'], 'hwmode', '11g') \
  10. end \
  11. end \
  12. curs = uci.cursor() \
  13. curs:foreach('wireless', 'wifi-device', change_mode) \
  14. curs:commit('wireless') \
  15. os.exit(0) \
  16. "
  17. echo ${FIX_SCRIPT} | /usr/bin/lua -
  18. exit ${?}