auvpn (486B)
1 #!/bin/sh 2 set -e 3 4 if [ "$(id -u)" = 0 ]; then 5 printf '%s: error: dont run with root' "${0##*/}" >&2 6 exit 1 7 fi 8 9 #pass="$(gpg2 -q -d ~/.password-store/Uni/mit.au.dk-217756.gpg)" 10 #authcode="$(pass otp Uni/2fa-au217756)" 11 #doas sh -c "printf '%s\n%s\n' '$pass' '$authcode' | \ 12 # openconnect -u au217756@uni.au.dk --passwd-on-stdin \ 13 # https://remote1.au.dk/st" 14 15 if [ -x /usr/bin/doas ]; then 16 doas=doas 17 else 18 doas=sudo 19 fi 20 21 $doas openconnect -u au217756@uni.au.dk https://remote1.au.dk/st