#!/usr/bin/expect -f

set username "$env(OVPN_LOGIN)\r"
set password "$env(OVPN_PASSWORD)\r"

spawn openvpn --config /config/$env(OVPN_CONFIG) --script-security 2
expect "Enter Auth Username:"
send $username
expect "Enter Auth Password:"
send $password
interact

#!/usr/bin/expect -f

set username "$env(OVPN_LOGIN)\r"
set password "$env(OVPN_PASSWORD)\r"

spawn openvpn --cd /config/ --config /config/$env(OVPN_CONFIG) --script-security 2
expect "Enter Auth Username:"
send $username
expect "Enter Auth Password:"
send $password
interact

Allow relative paths in config file
Allow relative paths in config file