Page 1 of 1

automatically mount network drives (OpenVPN-Client 2.4.5)

Posted: Thu Apr 05, 2018 12:19 pm
by bernhard.muehlbauer@ulb.hhu.de
Hi,

is it possible to implement a script thats runs after openvpn completed a secure connection?

Let me tell you, what I tried till now:

- installed OpenVPN-Client 2.4.5
- tried to insert one of the following lines in the Test.ovpn:
- up "C:\temp\OpenVPN\Config\Test_up.bat"
- up 'C:\temp\OpenVPN\Config\Test_up.bat'
- up C:\temp\OpenVPN\Config\Test_up.bat
- route-up "C:\temp\OpenVPN\Config\Test_up.bat"
- route-up 'C:\temp\OpenVPN\Config\Test_up.bat'
- route-up C:\temp\OpenVPN\Config\Test_up.bat
- ipChange "C:\temp\OpenVPN\Config\Test_up.bat"
- ipChange 'C:\temp\OpenVPN\Config\Test_up.bat'
- ipChange C:\temp\OpenVPN\Config\Test_up.bat
but no success. The script Test_up.bat was not executed.

Any ideas?

Thanks and best regards

Berny

Re: automatically mount network drives (OpenVPN-Client 2.4.5)

Posted: Thu Apr 05, 2018 12:54 pm
by TinCanTech
Read your log file ...

Re: automatically mount network drives (OpenVPN-Client 2.4.5)

Posted: Mon Apr 09, 2018 9:22 am
by bernhard.muehlbauer@ulb.hhu.de
problem solved.
The most import thing is, that I used the command "start" in the test_up.bat. This will produce a fork() and the gpUpdate_and_map.bat will never return.
Otherwise there will be a deadlock.

- my ovpn-File looks like this:
up 'C:\\Users\\test\\OpenVPN\\config\\test_up.bat'

- test_up.bat:
start .\gpUpdate_and_map.bat

- gpUpdate_and_map.bat:
:gpupdateOnceAgain
echo try to connect with AD ...
c:\windows\system32\gpupdate.exe
if errorlevel 0 goto gpupdateOK
goto gpupdateOnceAgain
:gpupdateOK