Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Q1="Do you want to proceed? (Y:Yes, N:No, V:View Certificate)Yes"
  2. Q2="One Time Password:"
  3.  
  4. get_otp(){
  5. for i in {1..60}
  6. do
  7. if otp_code is received; then
  8. echo otp_code
  9. exit
  10. else
  11. sleep 1
  12. fi
  13. done
  14. }
  15.  
  16. expect -c "
  17. spawn $SUDO connect_to_vpn
  18. expect {
  19. "$Q1" { send "Yes" }
  20. "$Q2" { Send "$(get_otp)" }
  21. }
  22. "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement