Hothersale
Occasional Visitor
I have a little script that makes a call to an API to find out which port has been assigned to me by my VPN provider.
The script works perfectly when I run it manually or when it is run as a cron job. A certain part of the script fails, however, when the script is called from the openvpn-event user script. This is the line of code:
The file "vpn_port" gets created, but it is empty instead of containing the port number. The curl command is failing somehow. All the variables are present and accounted for... I'm stumped. It's like openvpn-event doesn't have permission to execute the curl command or something.
Any of you bearded gurus have an idea what might be wrong?
Cheers,
Chris
The script works perfectly when I run it manually or when it is run as a cron job. A certain part of the script fails, however, when the script is called from the openvpn-event user script. This is the line of code:
Code:
curl -k -d "user=$PIANAME&pass=$PIAPASS&client_id=$CLIENTID&local_ip=$LOCALIP" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment 2>/dev/null|grep -oE "[0-9]+" > /tmp/vpn_port
The file "vpn_port" gets created, but it is empty instead of containing the port number. The curl command is failing somehow. All the variables are present and accounted for... I'm stumped. It's like openvpn-event doesn't have permission to execute the curl command or something.
Any of you bearded gurus have an idea what might be wrong?
Cheers,
Chris