aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2024-02-29 21:00:21 +0100
committerDirk Brenken <dev@brenken.org>2024-02-29 21:01:16 +0100
commitbec5f35dea7ac5b4b4b7d75a931be470a19d4f22 (patch)
tree68bc730a45b8ab5ad6b404efb51eb0fb8c032a1e
parent3917a0af5878eb7ce76feff9affd06902806f370 (diff)
travelmate: update 2.1.2-5
* final vpn tweaks Signed-off-by: Dirk Brenken <dev@brenken.org>
-rw-r--r--net/travelmate/Makefile2
-rwxr-xr-xnet/travelmate/files/travelmate.sh32
2 files changed, 12 insertions, 22 deletions
diff --git a/net/travelmate/Makefile b/net/travelmate/Makefile
index 25e38d122..971144b12 100644
--- a/net/travelmate/Makefile
+++ b/net/travelmate/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=2.1.2
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/travelmate/files/travelmate.sh b/net/travelmate/files/travelmate.sh
index 7dbb357ca..35a12c330 100755
--- a/net/travelmate/files/travelmate.sh
+++ b/net/travelmate/files/travelmate.sh
@@ -205,43 +205,37 @@ f_vpn() {
if [ ! -f "${trm_vpnfile}" ] || { [ -f "${trm_vpnfile}" ] && [ "${vpn_action}" = "enable" ]; }; then
for info in ${trm_vpninfolist}; do
iface="${info%%&&*}"
- if [ "${iface}" = "${info}" ]; then
- vpn_instance=""
- else
- vpn_instance="${info##*&&}"
- fi
vpn_status="$(ifstatus "${iface}" | "${trm_jsoncmd}" -ql1 -e '@.up')"
if [ "${vpn_status}" = "true" ]; then
/sbin/ifdown "${iface}"
"${trm_ubuscmd}" -S call network.interface."${iface}" remove >/dev/null 2>&1
- f_log "info" "take down vpn interface '${iface}/${vpn_instance:-"-"}' (initial)"
+ f_log "info" "take down vpn interface '${iface}' (initial)"
fi
+ [ "${iface}" = "${info}" ] && vpn_instance="" || vpn_instance="${info##*&&}"
if [ -x "/etc/init.d/openvpn" ] && [ -n "${vpn_instance}" ] && /etc/init.d/openvpn running "${vpn_instance}"; then
/etc/init.d/openvpn stop "${vpn_instance}"
- f_log "info" "take down openvpn instance '${vpn_instance:-"-"}' (initial)"
+ f_log "info" "take down openvpn instance '${vpn_instance}' (initial)"
fi
done
rm -f "${trm_vpnfile}"
elif [ "${vpn}" = "1" ] && [ -n "${vpn_iface}" ] && [ "${vpn_action}" = "enable_keep" ]; then
for info in ${trm_vpninfolist}; do
iface="${info%%&&*}"
- if [ "${iface}" = "${info}" ]; then
- vpn_instance=""
- else
- vpn_instance="${info##*&&}"
- fi
vpn_status="$(ifstatus "${iface}" | "${trm_jsoncmd}" -ql1 -e '@.up')"
if [ "${vpn_status}" = "true" ] && [ "${iface}" != "${vpn_iface}" ]; then
/sbin/ifdown "${iface}"
- f_log "info" "take down vpn interface '${iface}/${vpn_instance:-"-"}' (switch)"
- rm -f "${trm_vpnfile}"
- break
+ f_log "info" "take down vpn interface '${iface}' (switch)"
+ rc="1"
fi
+ [ "${iface}" = "${info}" ] && vpn_instance="" || vpn_instance="${info##*&&}"
if [ -x "/etc/init.d/openvpn" ] && [ -n "${vpn_instance}" ] && /etc/init.d/openvpn running "${vpn_instance}"; then
/etc/init.d/openvpn stop "${vpn_instance}"
- f_log "info" "take down openvpn instance '${vpn_instance:-"-"}' (switch)"
+ f_log "info" "take down openvpn instance '${vpn_instance}' (switch)"
+ rc="1"
fi
+ [ "${rc}" = "1" ] && break
done
+ rm -f "${trm_vpnfile}"
fi
if [ -x "${trm_vpnpgm}" ] && [ -n "${vpn_service}" ] && [ -n "${vpn_iface}" ]; then
if { [ "${vpn_action}" = "disable" ] && [ -f "${trm_vpnfile}" ]; } ||
@@ -251,11 +245,7 @@ f_vpn() {
for info in ${trm_vpninfolist}; do
iface="${info%%&&*}"
if [ "${iface}" = "${vpn_iface}" ]; then
- if [ "${iface}" = "${info}" ]; then
- vpn_instance=""
- else
- vpn_instance="${info##*&&}"
- fi
+ [ "${iface}" = "${info}" ] && vpn_instance="" || vpn_instance="${info##*&&}"
break
fi
done