Created
November 8, 2019 07:33
-
-
Save ehsanhoushmand/52bb9c5a1928719d5850dca3c9b114b5 to your computer and use it in GitHub Desktop.
openconnect script
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 characters
#!/bin/bash | |
username="" | |
password="" | |
url="nl.cisadd3.com:800" | |
pidfile="/tmp/openconnect-pid" | |
case "$1" in | |
start) | |
#bad certs | |
sudo openconnect $url -b -q --passwd-on-stdin --no-cert-check --pid-file=$pidfile --user=$username <<< "$password" | |
#sudo openconnect $url -b -q --passwd-on-stdin --servercert sha256:2e365ee95511c55fb044b30e489afde802005bb156522fa2599bff5ae95a7b9f --pid-file=$pidfile --user=$username <<< "$password" | |
;; | |
stop) | |
cat $pidfile | sudo xargs kill -2 | |
;; | |
*) | |
echo "$0 <start|stop>" | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment