Skip to content

Commit

Permalink
Merge pull request #1 from berombau/patch-1
Browse files Browse the repository at this point in the history
Simplify find-generic-password call to extract password - much cleaner thanks to @berombau
  • Loading branch information
ventz committed Jul 30, 2018
2 parents 20e183f + a263bb0 commit 73c0489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openconnect.sh
Expand Up @@ -45,12 +45,12 @@ VPN_USERNAME="vpn_username@domain.tld#VPN_TUNNEL_OPTIONALLY"
# b.) Click on "login" keychain (top left corner)
# c.) Click on "Passwords" category (bottom left corner)
# d.) From the "File" menu, select -> "New Password Item..."
# e.) For "Keychain Item Name" and "Account Name" use the value for "VPN_HOST"
# e.) For "Keychain Item Name" and "Account Name" use the value for "VPN_HOST" and "VPN_USERNAME" respectively
# f.) For "Password" enter your VPN AnyConnect password.

# This will retrieve that password securely at run time when you connect, and feed it to openconnect
# No storing passwords unenin plain text files! :)
GET_VPN_PASSWORD="security find-generic-password -g -a $VPN_HOST 2>&1 >/dev/null | cut -d'\"' -f2"
GET_VPN_PASSWORD="security find-generic-password -wl $VPN_HOST"

# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# END-OF-USER-SETTINGS #
Expand Down

0 comments on commit 73c0489

Please sign in to comment.