Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Q1="Do you want to proceed? (Y:Yes, N:No, V:View Certificate)Yes"
- Q2="One Time Password:"
- get_otp(){
- for i in {1..60}
- do
- if otp_code is received; then
- echo otp_code
- exit
- else
- sleep 1
- fi
- done
- }
- expect -c "
- spawn $SUDO connect_to_vpn
- expect {
- "$Q1" { send "Yes" }
- "$Q2" { Send "$(get_otp)" }
- }
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement