Browse Source

Merge pull request #10 from psteffen/patch-2

Changed connectivity_check
oscarminus 3 years ago
parent
commit
0cc6f952e9

+ 2 - 2
ffho-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback

@@ -48,10 +48,10 @@ local function preflight_check()
 end
 
 local function connectivity_check()
-  local f = io.open('/sys/kernel/debug/batman_adv/bat0/gateways', 'r')
+  local f = io.popen('batctl gwl -nH', 'r')
   if f then
     for line in f:lines() do
-      local gateway_mac = line:match('^=?>? +([0-9a-f:]+)')
+      local gateway_mac = line:match('^[ *]+([0-9a-f:]+)')
       if gateway_mac then
         if os.execute('batctl ping -t5 -c1 ' .. gateway_mac .. ' > /dev/null 2>&1') == 0 then
           return true