check_site.lua 803 B

1234567891011121314151617181920212223242526272829303132
  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('prefix4', '^%d+.%d+.%d+.%d+/%d+$')
  16. need_string_match('prefix6', '^[%x:]+/%d+$')
  17. for _, config in ipairs({'wifi24', 'wifi5'}) do
  18. if need_table(config, nil, false) then
  19. need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
  20. need_number(config .. '.channel')
  21. end
  22. end