Page 1 of 1

openvpn ipchange script not executing?

Posted: Sun Dec 25, 2016 1:48 pm
by djw77
Hi,

I can't seem to get an openvpn ipchange script to work in Viscosity 1.6.7 on macOS 10.12.2, not sure what I'm doing wrong, but the log always shows:
Dec 24 20:37:10: WARNING: Failed running command (--ipchange): external program exited with error status: 1
The relevant part of the (advanced) config is:
ipchange /usr/local/bin/vpn-ipchange.sh
script-security 2
I've tried placing the script alongside the configs in ~/Library/Application Support, /usr/local, my home directory, etc., various permissions (755 and 700) and owners (root and my uid), and just can't seem to get anything to run. Not even if I change it to /usr/bin/env or similar. What could I be missing?

I'd really like to have access to the interface name and the ip ($dev and $ifconfig_local), which don't seem to be as easily available in applescript.

Thanks for any help!

Re: openvpn ipchange script not executing?

Posted: Tue Jan 03, 2017 9:00 am
by James
Hi djw77,

An exit status of 1 means that the script was found and was attempted to be executed, but the script encountered a problem. This means there is a problem in the script. For shell/bash scripts it typically means there is a syntax error or another process it invokes could not be run. You may like to attempt some debugging, such as writing log messages to a file from the script to see where it's encountering a problem.

Cheers,
James

Re: openvpn ipchange script not executing?

Posted: Tue Jan 03, 2017 12:04 pm
by djw77
Indeed, /usr/bin/true works, I guess I was too deep in the weeds trying to get something to work. Looks like the environment passed to ipchange is nowhere near as complete as the up script, and that was my issue. Thanks!