IPFire with OpenVPN on iPhone script

Has anyone succesfully used this script?

I’ve followed the instructions step by step and all seems well, but when I try to run the script I get:


I verified that /bin/bash does exist. Initially I thought it was a line return issue as I copied the text from the page into notepad, saved it as the openvpncmd.sh, scp’d it to IPFire, changed the permissions, then tried to run it, I got the error, so I deleted the first line, and hand typed it again, and it produces the same result.

I am not talented at scripting so I can’t see where the ^M is coming in (or why) right after /bin/bash. I must be missing something obvious, any thoughts?


it is probably notepad and extra Windows characters…

There are a few sed commands you might try.

1 Like

I am too was never able to get the ios device to work with openvpn following wiki instruction. I have found another way to make openvpn to work with ios and it may not be the best but it is for person use only. From Ipfire download the client information and test it on windows pc to confirm your file is good. Then follow the instruction below to convert the .p12 file to certificate.cer file.

Prepare the file on ubuntu

  1. convert .p12 into something we can import into Openvpn. – navigate to the folder file where your .p12 file locate and right click and select Open in Terminal

USE THIS COMAND-to generate certificate.cer

openssl pkcs12 -in p12file.p12 -out certificate.cer -nodes


  1. open certificate.cer file with note pad editor and copy three section of information into ovpn file.

–How to correctly identify which part below to ca, cert and key from certificate.cer file.


The ca file have friendlyName: xxxxx CA

The cert file have friendlyName: xxxxx (or what remain from the three parts )

Copy the three information above into you .ovpn file. See the sample below

  1. Here is how your ovpn file should look like.

  1. Import the file to ios openvpn app

Thanks for the reply, I will try those instructions this afternoon.


Here is a wiki page for creating a manual .ovpn file:

@lowemissions - Can you pass on details of what did not work? I’d be happy to update the wiki.

For testing you can use this easy method with no password.

For my purposes I have adapted the ovpnmain.cgi and now have a ZIP package created for me, which I can use with OpenVPN Connect on my iOS devices …

1 Like

That is really needed! Would you be willing to submit to the Dev Mailing List?