[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Run script to mount devices after connecing (was OpenVPN GUI)


  • Subject: Re: [Openvpn-users] Run script to mount devices after connecing (was OpenVPN GUI)
  • From: Mathias Sundman <mathias@xxxxxxxxxx>
  • Date: Wed, 1 Sep 2004 22:14:32 +0200 (CEST)

On Wed, 1 Sep 2004, Raymond wrote:

You can also, of course, include a command in the --route-up script to
asynchronously execute another script then return immediately.  This will
solve the problem of the script locking up the OpenVPN event loop.

This is what I have attempted; I implement a base windows cmd script that utilizes the "call" function to initiate other cmd scripts ( smb, jabber, dns, firefox). The problems remain with both the smb and dns scripts hanging. However the jabber and and firefox scripts do initialize correctly.

"call" does not return until the called batch file has completed, so you will have the same problem as executing the commands from the first file. Use "start" instead. That together with a "sleep 3", first in the second batch file works for me to mount remote samba shares.


However, I still think a new option to execute such scripts would be cleaner to avoid this type of problems.

It would also be great if the exit status of such a script could be reported back to OpenVPN to generate a log message depending on if it succeded or not.

I'll investigate how to write a portable asynchronious version of system().


-- _________________________________________________________ Mathias Sundman (^) ASCII Ribbon Campaign NILINGS AB X NO HTML/RTF in e-mail Tel: +46-(0)8-666 32 28 / \ NO Word docs in e-mail