I think you just swipe |
and ||
operator.
|
plug standard output o the previous command to standard input of the next command.
||
launch second command only if first command fail (exit code != 0).
this command should work.
root$ echo mypassword | openvpn client.conf.ovpn