Browse Source

ffho-autoupdater-wifi-fallback: fix and improve

- fix naming within util.lua
- break if autoupdater was executed without errors
- use dual-stack interface
Karsten Böddeker 7 years ago
parent
commit
62cdb854ea

+ 10 - 1
ffho/ffho-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback

@@ -17,10 +17,19 @@ uci:section('autoupdater-wifi-fallback','autoupdater-wifi-fallback','settings',
 )
 
 uci:delete('wireless', 'fallback')
-
 uci:delete('network','fallback')
+uci:delete('network','fallback6')
+
 uci:section('network', 'interface', 'fallback',
   {
+    proto = 'dhcp',
+    peerdns = 1,
+    sourcefilter = 0,
+  }
+)
+uci:section('network', 'interface', 'fallback6',
+  {
+    ifname = '@fallback',
     proto = 'dhcpv6',
     peerdns = 1,
     sourcefilter = 0,

+ 1 - 1
ffho/ffho-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua

@@ -7,7 +7,7 @@ function get_available_wifi_networks()
 
   uci:foreach('wireless', 'wifi-device',
     function(s)
-      list[s['.name']] = {}
+      radios[s['.name']] = {}
     end
   )
 

+ 3 - 1
ffho/ffho-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback

@@ -131,7 +131,9 @@ if (force or preflight_check()) and not connectivity_check() then
     for radio, netlist in pairs(get_available_wifi_networks()) do
       for _, net in ipairs(netlist) do
         switch_to_fallback_mode(radio, net.ssid, net.bssid)
-        run_autoupdater()
+        if run_autoupdater() == 0 then
+          break
+        end
       end
     end
     -- this is only reached if no updated happened