metronom login vpn fix

This commit is contained in:
Tove 2025-09-14 18:34:12 +02:00
parent 4e6465defe
commit 448211660b
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -3,6 +3,8 @@
pkgs.writeShellScriptBin "metronom-login" ''
#!/bin/sh
mullvad disconnect
sleep 2
netif="$(cat ~/.direct-netif)"
echo "netif is (~/.direct-netif) $netif"
ip="$(dog -1 wifi.metronom.de @10.101.1.1 A)"
@ -10,6 +12,7 @@ pkgs.writeShellScriptBin "metronom-login" ''
csrf="$(curl --interface $(cat ~/.direct-netif) "$ip/de/" | grep CSRFToken | sed -E 's/.*value="([0-9a-f]*)".*/\1/')"
echo "csrf is $csrf"
resp="$(curl --interface $(cat ~/.direct-netif) "$ip/de/" -X POST -H "Cookie: csrf=$csrf" --data-raw "login=true&CSRFToken=$csrf" | wc -l)"
mullvad connect
if [ $resp = 0 ] ; then
echo OK
else