travelmate: release 2.1.2-1
authorDirk Brenken <dev@brenken.org>
Sat, 6 Jan 2024 18:53:30 +0000 (19:53 +0100)
committerDirk Brenken <dev@brenken.org>
Sat, 6 Jan 2024 18:55:32 +0000 (19:55 +0100)
* fix a station scanning issue on single radio units (mainly a LuCI/JS issue) reported in the forum by multiple users

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/travelmate/Makefile
net/travelmate/files/README.md
net/travelmate/files/travelmate.init

index ef0bf2779b3bc11d835f22ed004b761aa2ea1468..93f405efd8e434c806bac4d8bf70d2bc200f2707 100644 (file)
@@ -1,13 +1,13 @@
 #
-# Copyright (c) 2016-2023 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
-PKG_VERSION:=2.1.1
-PKG_RELEASE:=3
+PKG_VERSION:=2.1.2
+PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index c089e668ea53cf33132ba271127b4aa73008f51b..5b794cd55d91e51e34cde4c88449406dfad909a8 100644 (file)
@@ -43,9 +43,8 @@ To avoid these kind of deadlocks, travelmate will set all station interfaces to
 
 ## Installation & Usage
 * **Please note:** before you start with travelmate ...
-    * you should setup at least one Access Point, ideally on a separate radio,
-    * if you're updating from a former 1.x release, please use the '--force-reinstall --force-maintainer' options in opkg,
-    * and remove any existing travelmate related uplink stations in your wireless config manually
+    * setup at least one AP, ideally on a separate radio
+    * if you're using a single radio unit set the AP channel to 'auto'
 * download [travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
 * download [luci-app-travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
 * install both packages (_opkg install travelmate_, _opkg install luci-app-travelmate_)
index be10d77f2bd4d4f24db77e34b5818adacb52d30a..4a7dbf2609d75f1fb7e48e188ff1b134e8ed1cb1 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh /etc/rc.common
-# Copyright (c) 2016-2023 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 
 # set (s)hellcheck exceptions
@@ -15,6 +15,7 @@ extra_command "setup" "[<iface>] [<zone>] [<metric>] Setup the travelmate uplink
 trm_init="/etc/init.d/travelmate"
 trm_script="/usr/bin/travelmate.sh"
 trm_pidfile="/var/run/travelmate.pid"
+trm_scanfile="/var/run/travelmate.scan"
 
 boot() {
        if [ -s "${trm_pidfile}" ]; then
@@ -76,19 +77,20 @@ status_service() {
 }
 
 scan() {
-       local result scan_name radio="${1}"
+       local result radio="${1}"
 
+       : > "${trm_scanfile}"
        if [ -z "${radio}" ]; then
-               scan_name="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.up=true].interfaces[0].ifname')"
+               radio="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.up=true].interfaces[0].ifname')"
        fi
-       result="$(iwinfo "${radio:-${scan_name}}" scan 2>/dev/null |
+       result="$(iwinfo "${radio}" scan 2>/dev/null |
                awk 'BEGIN{FS="[[:space:]]"}/Address:/{var1=$NF}/ESSID:/{var2="";
                for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}/Channel:/{var3=$NF}/Quality:/{split($NF,var0,"/")}/Encryption:/{var4="";
                for(j=12;j<=NF;j++)if(var4==""){var4=$j}else{var4=var4" "$j};printf "    %-11i%-10s%-35s%-20s%s\n",(var0[1]*100/var0[2]),var3,var2,var1,var4}' |
                sort -rn)"
-       printf "%s\n" "::: Available nearby uplinks on '${radio:-${scan_name}}'"
-       printf "%s\n" ":::"
+       printf "::: %s\n:::\n" "Available nearby uplinks on '${radio}'"
        if [ -n "${result}" ]; then
+               printf "%s\n" "${result}" > "${trm_scanfile}"
                printf "%-15s%-10s%-35s%-20s%s\n" "    Strength" "Channel" "ESSID" "BSSID" "Encryption"
                printf "%s\n" "    --------------------------------------------------------------------------------------"
                printf "%s\n" "${result}"
@@ -162,13 +164,13 @@ setup() {
 }
 
 assoc() {
-       local result assoc_name radio="${1}"
+       local result radio="${1}"
 
        if [ -z "${radio}" ]; then
-               assoc_name="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.*.*.config.mode="ap"].interfaces[0].ifname')"
+               radio="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e '@[@.*.*.config.mode="ap"].interfaces[0].ifname')"
        fi
-       result="$(iwinfo "${radio:-${assoc_name}}" assoc 2>/dev/null | awk '/^[A-Z0-9:]+/{printf "    %s\n",$1}')"
-       printf "%s\n" "::: Associated wlan stations on '${radio:-${assoc_name}}'"
+       result="$(iwinfo "${radio}" assoc 2>/dev/null | awk '/^[A-Z0-9:]+/{printf "    %s\n",$1}')"
+       printf "%s\n" "::: Associated wlan stations on '${radio}'"
        printf "%s\n" ":::"
        if [ -n "${result}" ]; then
                printf "%s\n" "    MAC addresses"