the doc states
–ipchange cmd
Execute shell command cmd when our remote ip-address is initially authenticated or changes.
Execute as:
cmd ip_address port_number
If I'm reading this correctly the script is called with 2 arguments. IP and port#, however, on my machine both IP and port are being passed as 1 argument, and it seems that when verifying the IP with an external resource the IP returned is the unprotected IP (before establishing VPN connection). This is unexpected because the whole point of --ipchange is to execute a script after the ip has changed.
the ovpn file has the following
script-security 3
ipchange path_to_test.sh
The test.sh script it is calling is as follows
#!/bin/bash
log='/var/log/openvpn_script.log'
date >> $log
echo $1 >> $log
echo $2 >> $log
echo -e `curl -s curlmyip.net` >> $log
Which gives the following output
Fri Jul 5 19:58:30 UTC 2019
[AF_INET]207.189.31.115 1194
216.16.230.126
OpenVPN is started in --daemon mode.
Cheers,