From ce20f8d88be4fefaae15b06d18eef1639e992cd8 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 6 Jan 2024 19:53:30 +0100 Subject: [PATCH] travelmate: release 2.1.2-1 * 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 --- net/travelmate/Makefile | 6 +++--- net/travelmate/files/README.md | 5 ++--- net/travelmate/files/travelmate.init | 22 ++++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/net/travelmate/Makefile b/net/travelmate/Makefile index ef0bf2779b..93f405efd8 100644 --- a/net/travelmate/Makefile +++ b/net/travelmate/Makefile @@ -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 diff --git a/net/travelmate/files/README.md b/net/travelmate/files/README.md index c089e668ea..5b794cd55d 100644 --- a/net/travelmate/files/README.md +++ b/net/travelmate/files/README.md @@ -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_) diff --git a/net/travelmate/files/travelmate.init b/net/travelmate/files/travelmate.init index be10d77f2b..4a7dbf2609 100755 --- a/net/travelmate/files/travelmate.init +++ b/net/travelmate/files/travelmate.init @@ -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" "[] [] [] 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" -- 2.30.2