Whenever I use openvpn I'm stuck carting around 5 files, sending them over Bluetooth and cluttering up my phone's downloads directory or confusing people I'm setting up with openvpn
I decided finally to figure out inline openvpn client config files. I made this sed script/command that will automate the process:
sed -i "${1}.ovpn" -e '
/ca ca.crt/ {
a\<ca>
r ca.crt
a\</ca>
d
}' -e "
/cert client.crt/ {
a\<cert>
r ${1}.crt
a\</cert>
d
}" -e "
/key client.key/ {
a\<key>
r ${1}.key
a\</key>
d
}" -e '
/tls-auth ta.key 1/ {
a\key-direction 1
a\<tls-auth>
r ta.key
a\</tls-auth>
d
}'