Page 1 of 1

Client up script not firing.

Posted: Sun Jul 27, 2014 9:36 am
by pkfox
Title says it really, I have a script which mounts a share on my VPN server but I can't get it to fire when I connect using OpenVpn Connect , the lines I've added to my .ovpn file are shown below

Code: Select all

script-security 2
up /system/xbin/mymount.sh
the script has executable permissions and works perfectly from a command prompt but its not being executed by OpenVpn

Re: Client up script not firing.

Posted: Sun Jul 27, 2014 11:53 am
by pkfox
debbie10t wrote:Check your log for errors when running the script.

Note: up scripts are executed before the VPN is available, so if your script is trying to use the VPN it will fail.
Hi and thanks, I find that strange ( up scripts executing before the VPN is available ) , my script is indeed trying to use the VPN's ip address to mount a CIFS share so that explains why it fails ( no error message though it just doesn't work ) any idea how I can mount a share after the VPN comes up ?

Re: Client up script not firing.

Posted: Mon Jul 28, 2014 5:45 am
by pkfox
debbie10t wrote:
pkfox wrote:any idea how I can mount a share after the VPN comes up ?
By design, OpenVPN up script does not allow this as it is considered to be a security issue. However, forking a process has proven suitable for some users.

The way I do this is to use a File Monitor service which watches for a local file created by the up script. The Monitor process then launches processes independently of OpenVPN.
I see thanks, that means I've got to set up a FileSystemWatcher for Windows clients and something similar for Android and Linux clients what a bummer, all I want to do is mount a share that may or may not be exposed by the VPN - thanks again.

Re: Client up script not firing.

Posted: Mon Jul 28, 2014 11:38 am
by pkfox
debbie10t wrote:For windows you can create a shortcut to your network share and make it permanent, when the VPN becomes available windows will automatically connect to it. Sorry I can't help with android .. perhaps there is something similar.
Ok that's useful to know thanks - how do I make a shortcut permanent ?