210-interface-wan 702 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/lua
  2. local site = require 'gluon.site'
  3. local uci = require('simple-uci').cursor()
  4. local old_proto = uci:get('network', 'mesh_wan', 'proto')
  5. uci:section('network', 'interface', 'mesh_wan', {
  6. ifname = 'br-wan',
  7. proto = 'gluon_wired',
  8. index = 0,
  9. })
  10. if uci:get('network', 'mesh_wan', 'auto') == nil then
  11. uci:set('network', 'mesh_wan', 'auto', site.mesh_on_wan(false))
  12. end
  13. if uci:get('network', 'mesh_wan', 'transitive') == nil then
  14. uci:set('network', 'mesh_wan', 'transitive', true)
  15. end
  16. if uci:get('network', 'mesh_wan', 'legacy') == nil then
  17. uci:set('network', 'mesh_wan', 'legacy', old_proto == 'gluon_mesh')
  18. end
  19. uci:delete('network', 'mesh_wan', 'fixed_mtu')
  20. uci:save('network')