Open ddurbin opened 3 years ago
I guess a little off topic
There is also a problem when the password contains ";" I managed to solve it using this code, but I don't really know what I am doing.
ovpn_username="$(sed 's/;.*//' <<< "$VPN_AUTH")"
ovpn_password="$(sed 's/^[^;]*;//' <<< "$VPN_AUTH")"
vpn_auth "$ovpn_username" "$ovpn_password"
Sanitisation of input needs a complete overhaul.
@panos-stavrianos Could you send-in a PR for this?
There is a bug in the openvpn.sh script when passing with -a flag. The result is an unbound variable error.
/usr/bin/openvpn.sh: line 347: r: unbound variable
The fix is to replace lines 346 and 347 with below:
[[ "${VPN_AUTH:-}" ]] && eval vpn_auth $(sed 's/^/"/; s/\$/\\$/; s/$/"/; s/;/" "/g' <<< $VPN_AUTH)