This small script aims to facilitate access to a vpn, which has Google two-step authentication in command line.
$ sudo apt-get install openvpn
or $ sudo yum install openvpn
Note: For OSX you should follow this tutorial
$ sudo apt-get install expect
or $ sudo yum install expect
Note: For OSX you can try with HomeBrew
The script was designed to read the vpn.properties, just fill the correct information on each key.
Example
vpn.user=pepe
vpn.password=pepe1234
vpn.path=/home/pepe/vpn/
vpn.fileName=pepe-server-client.ovpn
To execute the script, you should use sudo privileges
sudo ./connect_vpn.sh
The scripts should be in same group with the login user but depending for your distro sometimes each script could has an unknown group.
You can fix with this command:
chown user:user file
and chmod +x file
Example
chown pepe:pepe connect_vpn.sh
and chmod +x connect_vpn.sh