diff options
author | Dirk Brenken <dev@brenken.org> | 2021-09-11 18:23:35 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2021-09-11 18:23:35 +0200 |
commit | 3167e00aff44c1ae5172f4c5547b3136caef6088 (patch) | |
tree | 09520e9ac9a49c88bf182afc93e75d7d8cc8870b /net/travelmate/files/julianahoeve.login | |
parent | a6968744d900e629b9e70a204e4fd6226634b21d (diff) |
travelmate: update to 2.0.7
* add wpa-supplicant package dependency
* removed no longer working 'db-bahn.login' and 'wifionice.login' auto-login scripts
* added the new 'wifibahn.login' script for auto-logins to captive portals WIFI@BAHN (DE),
run tested on a single ICE (station logins are currently unsupported!)
* vodafone.login prepared to support free/time limited logins (still WIP!)
* change return code handling in login scripts and travelmate
* refine f_wifi function
* fix a few conercase issues
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'net/travelmate/files/julianahoeve.login')
-rwxr-xr-x | net/travelmate/files/julianahoeve.login | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/net/travelmate/files/julianahoeve.login b/net/travelmate/files/julianahoeve.login index f4927c336..843ffc6ab 100755 --- a/net/travelmate/files/julianahoeve.login +++ b/net/travelmate/files/julianahoeve.login @@ -6,16 +6,12 @@ # set (s)hellcheck exceptions # shellcheck disable=1091,2039,2181,3040 +. "/lib/functions.sh" + export LC_ALL=C export PATH="/usr/sbin:/usr/bin:/sbin:/bin" set -o pipefail -# source function library if necessary -# -if [ -z "${_C}" ]; then - . "/lib/functions.sh" -fi - trm_domain="n23.network-auth.com" 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")" @@ -25,22 +21,16 @@ trm_fetch="$(command -v curl)" # get redirect url # redirect_url="$(${trm_fetch} --user-agent "${trm_useragent}" --referer "http://www.example.com" --connect-timeout $((trm_maxwait / 6)) --write-out "%{redirect_url}" --silent --show-error --output /dev/null "${trm_captiveurl}")" -if [ -z "${redirect_url}" ]; then - exit 1 -fi +[ -z "${redirect_url}" ] && exit 1 # get session cookie # "${trm_fetch}" --user-agent "${trm_useragent}" --referer "http://${trm_domain}" --silent --connect-timeout $((trm_maxwait / 6)) --cookie-jar "/tmp/${trm_domain}.cookie" --output /dev/null "${redirect_url}" session_id="$(awk '/p_splash_session/{print $7}' "/tmp/${trm_domain}.cookie" 2>/dev/null)" rm -f "/tmp/${trm_domain}.cookie" -if [ -z "${session_id}" ]; then - exit 2 -fi +[ -z "${session_id}" ] && exit 2 # final login request # "${trm_fetch}" --user-agent "${trm_useragent}" --referer "${redirect_url}" --silent --connect-timeout $((trm_maxwait / 6)) --header "Cookie: p_splash_session=${session_id};" --output /dev/null "https://${trm_domain}/Camping-Julianah/hi/IHYW9cx/grant" -if [ "${?}" != "0" ]; then - exit 3 -fi +[ "${?}" = "0" ] && exit 0 || exit 255 |