mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
travelmate: release 2.1.4
- fixed telekom login script (#27072) - fixed the connection tracking/f_net function, to stabilize (vpn) connections (#27235) - removed needless log message Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#
|
||||
# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2016-2025 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.3
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=2.1.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/sh
|
||||
# captive portal auto-login script for telekom hotspots (DE)
|
||||
# Copyright (c) 2021-2022 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2021-2025 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
# shellcheck disable=1091,3040,3043,3057
|
||||
# shellcheck disable=all
|
||||
|
||||
. "/lib/functions.sh"
|
||||
|
||||
@@ -36,7 +36,7 @@ export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
username="$(urlencode "${1}")"
|
||||
password="$(urlencode "${2}")"
|
||||
trm_domain="telekom.portal.fon.com"
|
||||
trm_domain="hotspot.t-mobile.net"
|
||||
trm_useragent="$(uci_get travelmate global trm_useragent "Mozilla/5.0 (Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0")"
|
||||
trm_captiveurl="$(uci_get travelmate global trm_captiveurl "http://detectportal.firefox.com")"
|
||||
trm_maxwait="$(uci_get travelmate global trm_maxwait "30")"
|
||||
@@ -50,6 +50,6 @@ redirect_url="$(printf "%s" "${raw_html}" | awk 'match(tolower($0),/<loginurl>.*
|
||||
|
||||
# final login request
|
||||
#
|
||||
raw_html="$("${trm_fetch}" --user-agent "${trm_useragent}" --referer "https://${trm_domain}" --connect-timeout $((trm_maxwait / 6)) --header "content-type: application/x-www-form-urlencoded" --location --silent --show-error --data "UserName=${username}&Password=${password}&FNAME=0&button=Login&OriginatingServer=http%3A%2F%2F${trm_captiveurl}" "${redirect_url}")"
|
||||
raw_html="$("${trm_fetch}" --user-agent "${trm_useragent}" --referer "https://${trm_domain}/wlan/rest/freeLogin" --connect-timeout $((trm_maxwait / 6)) --header "content-type: application/x-www-form-urlencoded" --location --silent --show-error --data "UserName=${username}&Password=${password}&FNAME=0&button=Login&OriginatingServer=http%3A%2F%2F${trm_captiveurl}" "${redirect_url}")"
|
||||
login_url="$(printf "%s" "${raw_html}" | awk 'match(tolower($0),/<logoffurl>.*<\/logoffurl>/){printf "%s",substr($0,RSTART+11,RLENGTH-23)}' 2>/dev/null)"
|
||||
[ -n "${login_url}" ] && exit 0 || exit 255
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# travelmate, a wlan connection manager for travel router
|
||||
# Copyright (c) 2016-2024 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2016-2025 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
@@ -624,7 +624,7 @@ f_addsta() {
|
||||
f_net() {
|
||||
local err_msg raw json_raw html_raw html_cp js_cp json_ec json_rc json_cp json_ed result="net nok"
|
||||
|
||||
raw="$("${trm_fetchcmd}" --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{json}" --silent --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
|
||||
raw="$("${trm_fetchcmd}" --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{json}" --silent --retry 5 --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
|
||||
json_raw="${raw#*\{}"
|
||||
html_raw="${raw%%\{*}"
|
||||
if [ -n "${json_raw}" ]; then
|
||||
@@ -916,7 +916,6 @@ f_main() {
|
||||
for radio in ${trm_radiolist}; do
|
||||
if ! printf "%s" "${trm_stalist}" | "${trm_grepcmd}" -q "\\-${radio}"; then
|
||||
if [ "${trm_autoadd}" = "0" ]; then
|
||||
f_log "info" "no enabled station on radio '${radio}'"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#!/bin/sh
|
||||
# vpn handler called by travelmate
|
||||
# Copyright (c) 2020-2023 Dirk Brenken (dev@brenken.org)
|
||||
# Copyright (c) 2020-2025 Dirk Brenken (dev@brenken.org)
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
|
||||
# set (s)hellcheck exceptions
|
||||
# shellcheck disable=all
|
||||
|
||||
# Please note: you have to setup the package 'wireguard' or 'openvpn' before using this script
|
||||
|
||||
. "/lib/functions.sh"
|
||||
|
||||
export LC_ALL=C
|
||||
@@ -30,7 +28,7 @@ trm_vpnfile="/var/state/travelmate.vpn"
|
||||
f_net() {
|
||||
local json_rc
|
||||
|
||||
json_rc="$(${trm_fetch} --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{response_code}" --silent --output /dev/null --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
|
||||
json_rc="$(${trm_fetch} --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{response_code}" --silent --retry 5 --output /dev/null --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
|
||||
if [ "${json_rc}" = "200" ] || [ "${json_rc}" = "204" ]; then
|
||||
json_rc="net ok"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user