Fix syntaxErr; add function to save a Pwd in KeyCh
This commit is contained in:
parent
85cb51f71e
commit
c62c2a7b58
8
bibVPN.sh
Normal file → Executable file
8
bibVPN.sh
Normal file → Executable file
@ -30,6 +30,12 @@ ICON_disconnected="iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAAGtemweAAAACXBIWXMAAAsSA
|
|||||||
# "security find-generic-password -g -a foo" where foo is an account
|
# "security find-generic-password -g -a foo" where foo is an account
|
||||||
# in your OSX Keychain, to avoid passwords stored in plain text
|
# 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"
|
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
|
# Command to determine if VPN is connected or disconnected
|
||||||
VPN_CONNECTED="ifconfig | egrep -A1 'inet 172.[123][0-9]' |cut -d' ' -f2"
|
VPN_CONNECTED="ifconfig | egrep -A1 'inet 172.[123][0-9]' |cut -d' ' -f2"
|
||||||
@ -87,7 +93,7 @@ else
|
|||||||
echo "| templateImage=$ICON_disconnected"
|
echo "| templateImage=$ICON_disconnected"
|
||||||
#echo "VPN ❌ | color=Crimson"
|
#echo "VPN ❌ | color=Crimson"
|
||||||
echo '---'
|
echo '---'
|
||||||
for config in (cat $ACCOUNTFILE) ; do
|
for config in $(cat $ACCOUNTFILE) ; do
|
||||||
cfgName=$config
|
cfgName=$config
|
||||||
cfgMail=
|
cfgMail=
|
||||||
cfgHost=
|
cfgHost=
|
||||||
|
Loading…
Reference in New Issue
Block a user