travelmate: handle invalid wireless sections
authorDirk Brenken <redacted>
Sat, 21 Nov 2020 17:17:51 +0000 (18:17 +0100)
committerDirk Brenken <redacted>
Sat, 21 Nov 2020 17:17:51 +0000 (18:17 +0100)
* ignore invalid wireless sections

Signed-off-by: Dirk Brenken <redacted>
net/travelmate/Makefile
net/travelmate/files/travelmate.sh

index bf6dd1563a97920839eb66c9dc4b8c2406c0b819..1f9935466c8366c9152a518d4802b756a19b3592 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
 PKG_VERSION:=2.0.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index a29a89d3d6175e833856c04cd2d3c83535db4b94..7edaac509a54daa8806f1e6f6365ea612beece51 100755 (executable)
@@ -73,7 +73,7 @@ f_env()
        #
        if [ ! -r "/etc/config/travelmate" ] || [ -z "$(uci -q show travelmate.global.trm_vpn)" ]
        then
-               f_log "err" "no valid travelmate config found, please re-install the package via opkg with the '--force-reinstall --force-maintainer' options"
+               f_log "err" "invalid travelmate config, please re-install the package via opkg with the '--force-reinstall --force-maintainer' options"
        fi
 
        # load travelmate config
@@ -871,6 +871,11 @@ f_main()
                                sta_bssid="$(uci_get "wireless" "${section}" "bssid")"
                                sta_iface="$(uci_get "wireless" "${section}" "network")"
                                sta_mac="$(f_mac "get" "${section}")"
+                               if [ -z "${sta_radio}" ] || [ -z "${sta_essid}" ] || [ -z "${sta_iface}" ]
+                               then
+                                       f_log "info" "invalid wireless section '${section}'"
+                                       continue
+                               fi
                                if [ "${sta_radio}" = "${config_radio}" ] && [ "${sta_essid}" = "${config_essid}" ] && [ "${sta_bssid}" = "${config_bssid}" ]
                                then
                                        f_contrack "refresh" "${config_radio}" "${config_essid}" "${config_bssid}"
git clone https://git.99rst.org/PROJECT