check_site.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. need_string 'site_code'
  2. need_string 'site_name'
  3. if need_table('opkg', nil, false) then
  4. need_string('opkg.openwrt', false)
  5. function check_repo(k, _)
  6. -- this is not actually a uci name, but using the same naming rules here is fine
  7. assert_uci_name(k)
  8. need_string(string.format('opkg.extra[%q]', k))
  9. end
  10. need_table('opkg.extra', check_repo, false)
  11. end
  12. need_string('hostname_prefix', false)
  13. need_string 'timezone'
  14. need_string_array('ntp_servers', false)
  15. need_string_match('prefix6', '^[%x:]+/%d+$')
  16. for _, config in ipairs({'wifi24', 'wifi5'}) do
  17. if need_table(config, nil, false) then
  18. need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
  19. need_number(config .. '.channel')
  20. local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
  21. local supported_rates = need_array_of(config .. '.supported_rates', rates, false)
  22. if supported_rates then
  23. need_array_of(config .. '.basic_rate', supported_rates, true)
  24. else
  25. need_array_of(config .. '.basic_rate', rates, false)
  26. end
  27. end
  28. end
  29. need_boolean('poe_passthrough', false)