From 0ee0aa2b5399606741bfa21e994f4869e04a9d28 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Thu, 23 Jun 2022 09:14:27 +0200 Subject: [PATCH] travelmate: update 2.0.8 * the domain whitelist feature has been extended to free up multiple nested captive portal domains. Signed-off-by: Dirk Brenken --- net/travelmate/Makefile | 6 +++--- net/travelmate/files/travelmate.sh | 27 ++++++++++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/net/travelmate/Makefile b/net/travelmate/Makefile index 2b7f640d0c..8b345f8356 100644 --- a/net/travelmate/Makefile +++ b/net/travelmate/Makefile @@ -1,13 +1,13 @@ # -# Copyright (c) 2016-2021 Dirk Brenken (dev@brenken.org) +# Copyright (c) 2016-2022 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.0.7 -PKG_RELEASE:=3 +PKG_VERSION:=2.0.8 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/travelmate/files/travelmate.sh b/net/travelmate/files/travelmate.sh index e0a6b49771..f1061c9f74 100755 --- a/net/travelmate/files/travelmate.sh +++ b/net/travelmate/files/travelmate.sh @@ -1,6 +1,6 @@ #!/bin/sh # travelmate, a wlan connection manager for travel router -# Copyright (c) 2016-2021 Dirk Brenken (dev@brenken.org) +# Copyright (c) 2016-2022 Dirk Brenken (dev@brenken.org) # This is free software, licensed under the GNU General Public License v3. # set (s)hellcheck exceptions @@ -10,7 +10,7 @@ export LC_ALL=C export PATH="/usr/sbin:/usr/bin:/sbin:/bin" set -o pipefail -trm_ver="2.0.7" +trm_ver="2.0.8" trm_enabled="0" trm_debug="0" trm_iface="" @@ -564,15 +564,20 @@ f_check() { if [ "${trm_ifstatus}" = "true" ]; then result="$(f_net)" if [ "${trm_captive}" = "1" ]; then - cp_domain="$(printf "%s" "${result}" | awk -F '['\''| ]' '/^net cp/{printf "%s",$4}')" - if [ -x "/etc/init.d/dnsmasq" ] && [ -f "/etc/config/dhcp" ] && - [ -n "${cp_domain}" ] && ! uci_get "dhcp" "@dnsmasq[0]" "rebind_domain" | grep -q "${cp_domain}"; then - uci_add_list "dhcp" "@dnsmasq[0]" "rebind_domain" "${cp_domain}" - uci_commit "dhcp" - /etc/init.d/dnsmasq reload - f_log "info" "captive portal domain '${cp_domain}' added to to dhcp rebind whitelist" - fi - if [ -n "${cp_domain}" ] && [ "${trm_captive}" = "1" ]; then + while true; do + cp_domain="$(printf "%s" "${result}" | awk -F '['\''| ]' '/^net cp/{printf "%s",$4}')" + if [ -x "/etc/init.d/dnsmasq" ] && [ -f "/etc/config/dhcp" ] && + [ -n "${cp_domain}" ] && ! uci_get "dhcp" "@dnsmasq[0]" "rebind_domain" | grep -q "${cp_domain}"; then + uci_add_list "dhcp" "@dnsmasq[0]" "rebind_domain" "${cp_domain}" + uci_commit "dhcp" + /etc/init.d/dnsmasq reload + f_log "info" "captive portal domain '${cp_domain}' added to to dhcp rebind whitelist" + else + break + fi + result="$(f_net)" + done + if [ -n "${cp_domain}" ]; then trm_connection="${result:-"-"}/${trm_ifquality}" f_jsnup login_script="$(f_getval "script")" -- 2.30.2