aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2017-05-10 16:49:24 +0200
committerDirk Brenken <dev@brenken.org>2017-05-10 16:49:24 +0200
commitb059c59d8612552d344059c20af6aa1bd1d9d2f5 (patch)
tree1f0f03e2716705f463eade1332f7c35e29c5f63a
parentc29c5d498ec02b917ca266929442bd0ddac3f2b1 (diff)
travelmate: update 0.7.3
backend: * refine connection check (reduce ubus polling) * further stabilize sta-/ap-handling frontend (see LuCI repo): * Automatically refresh the overview page after button onclick event, e.g. 'Save & Apply' Signed-off-by: Dirk Brenken <dev@brenken.org>
-rw-r--r--net/travelmate/Makefile2
-rwxr-xr-xnet/travelmate/files/travelmate.sh48
2 files changed, 25 insertions, 25 deletions
diff --git a/net/travelmate/Makefile b/net/travelmate/Makefile
index a5ffe4660..67b49d091 100644
--- a/net/travelmate/Makefile
+++ b/net/travelmate/Makefile
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
-PKG_VERSION:=0.7.2
+PKG_VERSION:=0.7.3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/travelmate/files/travelmate.sh b/net/travelmate/files/travelmate.sh
index 7919d3035..f17622688 100755
--- a/net/travelmate/files/travelmate.sh
+++ b/net/travelmate/files/travelmate.sh
@@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_ver="0.7.2"
+trm_ver="0.7.3"
trm_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
trm_enabled=0
trm_debug=0
@@ -93,31 +93,35 @@ f_prepare()
#
f_check()
{
- local ifname radio cnt=1 mode="${1}"
+ local ifname radio status cnt=1 mode="${1}"
trm_ifstatus="false"
while [ ${cnt} -le ${trm_maxwait} ]
do
- if [ "${mode}" = "ap" ]
+ status="$(ubus -S call network.wireless status 2>/dev/null)"
+ if [ -n "${status}" ]
then
- for radio in ${trm_radiolist}
- do
- trm_ifstatus="$(ubus -S call network.wireless status | jsonfilter -e "@.${radio}.up")"
- if [ "${trm_ifstatus}" = "true" ]
+ if [ "${mode}" = "ap" ]
+ then
+ for radio in ${trm_radiolist}
+ do
+ trm_ifstatus="$(printf "%s" "${status}" | jsonfilter -e "@.${radio}.up")"
+ if [ "${trm_ifstatus}" = "true" ]
+ then
+ trm_aplist="${trm_aplist} $(printf "%s" "${status}" | jsonfilter -e "@.${radio}.interfaces[@.config.mode=\"ap\"].ifname")_${radio}"
+ ifname="${trm_aplist}"
+ else
+ trm_aplist=""
+ trm_ifstatus="false"
+ break
+ fi
+ done
+ else
+ ifname="$(printf "%s" "${status}" | jsonfilter -e '@.*.interfaces[@.config.mode="sta"].ifname')"
+ if [ -n "${ifname}" ]
then
- trm_aplist="${trm_aplist} $(ubus -S call network.wireless status | jsonfilter -e "@.${radio}.interfaces[@.config.mode=\"ap\"].ifname")_${radio}"
- ifname="${trm_aplist}"
- else
- trm_aplist=""
- trm_ifstatus="false"
- break
+ trm_ifstatus="$(ubus -S call network.interface dump 2>/dev/null | jsonfilter -e "@.interface[@.device=\"${ifname}\"].up")"
fi
- done
- else
- ifname="$(ubus -S call network.wireless status | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
- if [ -n "${ifname}" ]
- then
- trm_ifstatus="$(ubus -S call network.interface dump | jsonfilter -e "@.interface[@.device=\"${ifname}\"].up")"
fi
fi
if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
@@ -201,14 +205,10 @@ f_main()
if [ -n "$(uci -q changes wireless)" ]
then
uci -q commit wireless
- ubus call network reload
+ ubus call network restart
fi
f_check "ap"
f_log "debug" "ap-list: ${trm_aplist}, sta-list: ${trm_stalist}"
- if [ -z "${trm_aplist}" ] || [ -z "${trm_stalist}" ]
- then
- f_log "error" "no usable AP/STA configuration found"
- fi
for ap in ${trm_aplist}
do
cnt=1