From 68487566019b6462c68c1d6d4273be33e9b0d243 Mon Sep 17 00:00:00 2001 From: privatereese <5148715+privatereese@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:38:55 +0200 Subject: [PATCH 1/2] tecff-ssid-changer: fix gateway TQ detection when online via WAN/VPN and bump release to 6 --- tecff-ssid-changer/Makefile | 2 +- .../files/lib/gluon/ssid-changer/ssid-changer.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tecff-ssid-changer/Makefile b/tecff-ssid-changer/Makefile index 4ea49d1..9b6d5e8 100644 --- a/tecff-ssid-changer/Makefile +++ b/tecff-ssid-changer/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tecff-ssid-changer PKG_VERSION:=2 -PKG_RELEASE:=0 +PKG_RELEASE:=6 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh b/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh index 9a3dd37..2d59226 100755 --- a/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh +++ b/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh @@ -66,7 +66,11 @@ fi # check for an active gateway and get its connection quality (TQ) GATEWAY_TQ=0 if [ -f /var/gluon/state/has_default_gw4 ]; then - GATEWAY_TQ="$(batctl gwl -H | grep -e "^\*" | awk -F'[()]' '{print $2}' | tr -d " ")" + GATEWAY_TQ="$(batctl gwl -H 2>/dev/null | grep -e "^\*" | awk -F'[()]' '{print $2}' | tr -d " ")" + # Fallback if default gateway exists but no batman gateway is selected (e.g., node is online via WAN/VPN) + if [ -z "$GATEWAY_TQ" ]; then + GATEWAY_TQ=255 + fi fi HUP_NEEDED=false From 9083c0ded66fbbd0253de97c29322b9fc8654df9 Mon Sep 17 00:00:00 2001 From: privatereese <5148715+privatereese@users.noreply.github.com> Date: Thu, 11 Jun 2026 14:30:50 +0200 Subject: [PATCH 2/2] Fix syntax and logic errors in tecff-autoupdater-wifi-fallback package --- tecff-autoupdater-wifi-fallback/Makefile | 2 +- .../gluon/upgrade/510-autoupdater-wifi-fallback | 3 ++- .../lib/lua/autoupdater-wifi-fallback/util.lua | 17 +++++++++-------- .../luasrc/usr/sbin/autoupdater-wifi-fallback | 2 +- .../lib/gluon/ssid-changer/ssid-changer.sh | 4 ++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/tecff-autoupdater-wifi-fallback/Makefile b/tecff-autoupdater-wifi-fallback/Makefile index 7716e53..370ff62 100644 --- a/tecff-autoupdater-wifi-fallback/Makefile +++ b/tecff-autoupdater-wifi-fallback/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tecff-autoupdater-wifi-fallback -PKG_VERSION:=6 +PKG_VERSION:=7 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DEPENDS := respondd diff --git a/tecff-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback b/tecff-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback index ed5c42e..0cd9771 100755 --- a/tecff-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback +++ b/tecff-autoupdater-wifi-fallback/luasrc/lib/gluon/upgrade/510-autoupdater-wifi-fallback @@ -89,7 +89,8 @@ uci:save('autoupdater-wifi-fallback') uci:save('network') uci:save('firewall') -local minute = tonumber(util.readfile('/usr/lib/micron.d/autoupdater'):match('^([0-9][0-9]?)%s')) +local content = util.readfile('/usr/lib/micron.d/autoupdater') +local minute = content and tonumber(content:match('^([0-9][0-9]?)%s')) or 0 minute = (minute + 10) % 60 local f = io.open('/usr/lib/micron.d/autoupdater-wifi-fallback', 'w') diff --git a/tecff-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua b/tecff-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua index 27dcaab..163c197 100644 --- a/tecff-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua +++ b/tecff-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua @@ -27,14 +27,15 @@ function M.get_available_wifi_networks() for radio, _ in pairs(radios) do local wifitype = iwinfo.type(radio) - local iw = iwinfo[wifitype] - if not iw then - return null - end - local tmplist = iw.scanlist(radio) - for _, net in ipairs(tmplist) do - if net.ssid and net.bssid and net.ssid:match('.*[Ff][Rr][Ee][Ii][Ff][Uu][Nn][Kk].*') then - table.insert (radios[radio], net) + local iw = wifitype and iwinfo[wifitype] + if iw then + local tmplist = iw.scanlist(radio) + if tmplist then + for _, net in ipairs(tmplist) do + if net.ssid and net.bssid and net.ssid:match('.*[Ff][Rr][Ee][Ii][Ff][Uu][Nn][Kk].*') then + table.insert (radios[radio], net) + end + end end end end diff --git a/tecff-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback b/tecff-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback index 809aa55..4632d65 100755 --- a/tecff-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback +++ b/tecff-autoupdater-wifi-fallback/luasrc/usr/sbin/autoupdater-wifi-fallback @@ -91,7 +91,7 @@ end local function run_autoupdater() autil.log('out', 'executing the autoupdater...') - os.execute('/usr/sbin/autoupdater -f -b ' .. branch_name) + return os.execute('/usr/sbin/autoupdater -f -b ' .. branch_name) end local function switch_to_fallback_mode(radio, ssid, bssid) diff --git a/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh b/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh index 2d59226..c1ca508 100755 --- a/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh +++ b/tecff-ssid-changer/files/lib/gluon/ssid-changer/ssid-changer.sh @@ -67,9 +67,9 @@ fi GATEWAY_TQ=0 if [ -f /var/gluon/state/has_default_gw4 ]; then GATEWAY_TQ="$(batctl gwl -H 2>/dev/null | grep -e "^\*" | awk -F'[()]' '{print $2}' | tr -d " ")" - # Fallback if default gateway exists but no batman gateway is selected (e.g., node is online via WAN/VPN) + # Fallback if default gateway exists but no batman gateway is selected (node is offline for clients) if [ -z "$GATEWAY_TQ" ]; then - GATEWAY_TQ=255 + GATEWAY_TQ=0 fi fi