labbots / OVPN-Config-Manipulator

Bash script to merge/split OVPN files. Open VPN config file (.ovpn) contains several certificates and key files which are required for the setup. This script allows you to merge those certificates and keys into single config file. The script can also be used to split a single self-contained ovpn config file to individual config and cert files.
MIT License
20 stars 3 forks source link

Not working for ovpn file downloaded from OpenVPN Cloud #5

Open wdliu356 opened 1 year ago

wdliu356 commented 1 year ago

I tried to split the .ovpn file downloaded from OpenVPN Cloud but it is giving me error messages listed as follows tr: missing operand after ‘[:upper:] [:lower:]’ Two strings must be given when translating. Try 'tr --help' for more information. tr: missing operand after ‘[:upper:] [:lower:]’ Two strings must be given when translating. Try 'tr --help' for more information. tr: missing operand after ‘[:upper:] [:lower:]’ Two strings must be given when translating. Try 'tr --help' for more information. tr: missing operand after ‘[:upper:] [:lower:]’ Two strings must be given when translating. Try 'tr --help' for more information. Invalid open vpn file extension

marcobelmonte commented 1 year ago

same error when trying to use the script on OpenVPN client configuration file downloaded from hackthebox.com :-(

Mikael-Aberg commented 1 month ago

I got the same error on a file from hotspot shield and was able to solve it by replacing line 172 with this and it seems to be working so far at least

if [ "$(echo "$EXTENSION" | tr '[:upper:]' '[:lower:]')" = "$(echo "conf" | tr '[:upper:]' '[:lower:]')" ] || [ "$(echo "$EXTENSION" | tr '[:upper:]' '[:lower:]')" = "$(echo "ovpn" | tr '[:upper:]' '[:lower:]')" ]; then