Last active
July 4, 2023 15:35
-
-
Save danpetrv/44513c8846a1169b7a93f51767cc223a to your computer and use it in GitHub Desktop.
Revisions
-
danpetrv revised this gist
Jul 4, 2023 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,10 +5,10 @@ chmod 600 ~/.vpn_password # add these lines to .zshrc or .zprofile function vpn-up() { local VPN_HOST="host" local VPN_USER="username" local SERVER_CERT="pin-sha256:87+Hf09J6X30/vKmSGLPA35scH/jey/aP7zL4sQ+5+i=" local VPN_AUTH_GROUP="authgroup" if [ ! -f ~/.vpn_password ]; then echo "Error: missing ~/.vpn_password" -
danpetrv created this gist
Jul 4, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ # add your vpn password to .vpn_password file echo "mypassword > ~/.vpn_password chmod 600 ~/.vpn_password # add these lines to .zshrc or .zprofile function vpn-up() { local VPN_HOST="<host>" local VPN_USER="<username>" local SERVER_CERT="pin-sha256:<cert>" local VPN_AUTH_GROUP="<authgroup>" if [ ! -f ~/.vpn_password ]; then echo "Error: missing ~/.vpn_password" return fi echo "Starting the vpn ..." echo $(cat ~/.vpn_password) | sudo openconnect --background --passwd-on-stdin --user=$VPN_USER --servercert=$SERVER_CERT --authgroup=$VPN_AUTH_GROUP $VPN_HOST } function vpn-down() { sudo kill -2 `pgrep openconnect` echo "\n" }