Use Remote Host IP of OVPN interface as a variable in a bash script.
How would I go about setting a variable in a bash script to the remote host of ovpnc1?
Pippin last edited by
Need more info, guess take a look at Environmental Variables on:
The closest thing I can find there is --show-gateway, which lists the IP of the gateway interface that OpenVPN uses to make its connections. I don't see any commands that give me the remote host information shown on status_openvpn.php in webconfigurator.
edit: Success! I accomplished what I wanted by using the following:
INTERFACEIP=`dig @resolver1.opendns.com ovpnc1 myip.opendns.com +short`