Guest User

Untitled

a guest
Jan 9th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. HOST=vpn.address
  4. USERNAME=$(lpass show --sync=auto --username pwd_entry)
  5. PASSWORD=$(lpass show --sync=auto --password pwd_entry)
  6. ESC_PWD=$(echo $PASSWORD | sed -e 's/[]\/$*.^[]/\\&/g')
  7.  
  8. echo "connecting to $HOST vpn as $USERNAME"
  9.  
  10. printf "${USERNAME}\n${PASSWORD}\ny" | /opt/cisco/anyconnect/bin/vpn -s connect $HOST | sed "s/$ESC_PWD/*****/"
Add Comment
Please, Sign In to add comment