Skip to content

Instantly share code, notes, and snippets.

@ehsanhoushmand
Created November 8, 2019 07:33
Show Gist options
  • Save ehsanhoushmand/52bb9c5a1928719d5850dca3c9b114b5 to your computer and use it in GitHub Desktop.
Save ehsanhoushmand/52bb9c5a1928719d5850dca3c9b114b5 to your computer and use it in GitHub Desktop.
openconnect script
#!/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