How to set up a VPN on Linux in 5 minutes for free
CodeDraken
1083

Hey, I’m loving the tutorial! Awesome job. 
I took a shot at writing a start script for the VPN.

#!/bin/bash
cd /path/to/VPNBook.com-OpenVPN-Euro1
username="vpnbook"
password="he2qv5h"
read -sp "Enter Sudo Password: " sudopassword
/usr/bin/expect << EOF
spawn sudo openvpn vpnbook-euro1-tcp443.ovpn
expect "password for $USER: "
send "$sudopassword\r"
expect "Enter Auth Username: "
send "$username\r"
expect "Enter Auth Password: "
send "$password\r"
expect "$ "
EOF

This will start the VPN without the need to enter the username and password manually. The VPN will also stay running in the background. Here’s a script for killing it if the need arises.

#!/bin/bash
sudo pkill vpn

Hope this makes it easier to use.

Cheers!