diff --git a/bibVPN.sh b/bibVPN.sh old mode 100644 new mode 100755 index e3ff830..3d7216e --- a/bibVPN.sh +++ b/bibVPN.sh @@ -30,6 +30,12 @@ ICON_disconnected="iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAAGtemweAAAACXBIWXMAAAsSA # "security find-generic-password -g -a foo" where foo is an account # in your OSX Keychain, to avoid passwords stored in plain text GET_VPN_PASSWORD="security find-generic-password -g -a $VPN_USERNAME 2>&1 >/dev/null | cut -d'\"' -f2" +if [ -z $GET_VPN_PASSWORD ] ; then + if $(read "Es wurde kein Passwort im Schlüsselbund gefunden. Soll dort eins hinterlegt werden? (ja/nein)") == '[Jj][aA]' ; then + local $keychainPW = $(read "Wie lautet das Password für den Benutzer $VPN_USERNAME ?") + security add-generic-password -a $VPN_USERNAME -s openconnect -w $keychainPW + fi +fi # Command to determine if VPN is connected or disconnected VPN_CONNECTED="ifconfig | egrep -A1 'inet 172.[123][0-9]' |cut -d' ' -f2" @@ -87,7 +93,7 @@ else echo "| templateImage=$ICON_disconnected" #echo "VPN ❌ | color=Crimson" echo '---' - for config in (cat $ACCOUNTFILE) ; do + for config in $(cat $ACCOUNTFILE) ; do cfgName=$config cfgMail= cfgHost=