Created
March 19, 2022 19:29
-
-
Save ihebski/579e16f70d0ad48684d060aa79c68b66 to your computer and use it in GitHub Desktop.
auto connect to vpn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# Constants | |
set user "" | |
set pass "" | |
set timeout -1 | |
# Options | |
match_max 100000 | |
log_user 0 | |
# Access to device | |
spawn sudo openvpn vpn_file.ovpn | |
expect "*?sername:*" | |
send -- "$user\r" | |
expect "*?assword:*" | |
send -- "$pass\r" | |
interact | |
close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment