I would like to combine VPN certificates into a single file. This is a template file:
# some unrelated stuff ca ca.crt # other unrelated stuff
And I want to replace line
ca ca.crt with the following content:
<ca> # ca.crt contents </ca>
I tried this script:
cat client-template.ovpn | sed -e 's/ca ca.crt/<ca>\n<\/ca>/' | sed -e '/<ca>/r ca.crt'
Although this script works fine, I have to paste two other files along with
ca.crt, and I would like to know, is there any command, which allows to combine both
r commands together?
I am using
sed, but answers with other Unix tools are welcome.