From a757d917b41e603f932143fabd47e69e2e65451f Mon Sep 17 00:00:00 2001 From: Thomas Schmauder Date: Fri, 11 Oct 2024 08:52:42 +0200 Subject: [PATCH] fix to get password macos seqoia --- bibVPN.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bibVPN.sh b/bibVPN.sh index 6cc2a66..c72b748 100755 --- a/bibVPN.sh +++ b/bibVPN.sh @@ -131,7 +131,7 @@ else fi # A command that will result in your VPN password. -GET_VPN_PASSWORD="security find-generic-password -g -a $VPN_USERNAME 2>&1 >/dev/null | cut -d'\"' -f2" +GET_VPN_PASSWORD="security find-generic-password -w -l openconnect -a $VPN_USERNAME 2>&1" # Command to determine if VPN is connected or disconnected VPN_CONNECTED="ifconfig | egrep -A1 '$NET_FILTER' |cut -d' ' -f2" # Command to run to disconnect VPN @@ -269,7 +269,13 @@ if [ -f $OC_PIDFILE ]; then aUser=$(ps -ef | grep -e '--user\ ' | cut -d' ' -f 32) if [[ $aUser =~ .*@.* ]]; then echo "User: $aUser" ; fi echo "IP: $IP" - echo "Verbunden seit: $(stat $OC_PIDFILE | cut -d'"' -f4)" + pidTime=$(stat $OC_PIDFILE | cut -d'"' -f4) + + + startZeit=$(date -j -f "%b %d %H:%M:%S %Y" "$pidTime" +%s) + now=$(date +%s) + seitZeit="$(( (now-startZeit) ))" + echo "Verbunden seit: $pidTime ($seitZeit Sek ~ $(( seitZeit/60 )) Min) " showSettings exit else