Eu escrevi um script de shell que busca a senha do keychain e a cola no pop-up. Você precisa criar um item de chaveiro com a senha para que isso funcione.
# VPN.sh
# change these variables for your setup
keychainItem=accountWithPassword # this name has to match "Account" for the entry you make in keychain
VPNName="VPN (Cisco IPSec)" # match the name of the VPN service to run
get_pw () {
security 2>&1 >/dev/null find-generic-password -ga $keychainItem \
|ruby -e 'print $1 if STDIN.gets =~ /^password: "(.*)"$/'
}
echo "fetching VPN credentials from keychain account \"$keychainItem\""
echo "Using VPN service: $VPNName"
scutil --nc start "$VPNName"
sleep 2.7
osascript -e "tell application \"System Events\" to keystroke \"$(get_pw)\""
osascript -e "tell application \"System Events\" to keystroke return"
sleep 2
exit