I don't know what happened to my last response but the problem was systemd,
using "systemctl start openvpn@leroy" with "verb 6" produced
Options error: --up script fails with '/tmp/openvpn-test': No such file or
directory
However, "ls -al /tmp/openvpn-show" returns (and yes, I have "script-security
2" in the configuration file)
-rwxr-xr-x 1 root root 118 Aug 6 12:48 /tmp/openvpn-test
and
"openvpn --config /etc/openvpn/leroy.conf &" works (checked with "ip route")
Is there something special I need to do to get it to work with systemd?
Moving on, now that I know a way to get it to work I've encountered a second
issue, how to get environment variables passed to the script. I discovered
that by using
#!/bin/bash/bin/echo -e "\n###\na $1 - $2 - $3 - $4 - $5 - $6 - $7 - $8 - $9 -
$10 b\n" >> /tmp/openvpn-showexit 0
I get six parameters if I don't add anything after the "up" command:
###a tun0 - 1500 - 1542 - 10.57.3.1 - 10.57.3.2 - init - - - - tun00 b
which matches the documentation (I don't know why $10 returns $1 with a 0
appended to it)
But, to get "-remote_host", I've tried:
up /tmp/openvpn-test\ remote_host get "remote_host" in the outputup
/tmp/openvpn-test\ $remote_host get "$remote_host" in the outputup
/tmp/openvpn-test\ -remote_host get "-remote_host" in the outputup
/tmp/openvpn-test\ \$remote_host get "Bad backslash ('\') usage ..."
up /tmp/openvpn-test\ \\$remote_host get "--up script fails with
'/tmp/openvpn-test \$remote_host': No such file or directory"
(based on the "-remote_host" under
https://openvpn.net/community-resources/reference-manual-for-openvpn-2-3/ and,
yes, I'm running 2.3.10 on Ubuntu 16). I also tried all configuration directly
on the command line - same result.
What haven't i tried (which will work?) Thanks for any help.
_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users