automatically mount network drives (OpenVPN-Client 2.4.5)

How to customize and extend your OpenVPN installation.
Post Reply
bernhard.muehlbauer@ulb.hhu.de
OpenVpn Newbie
Posts: 2
Joined: Thu Apr 05, 2018 11:55 am

automatically mount network drives (OpenVPN-Client 2.4.5)

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

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

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 4422
Joined: Fri Jun 03, 2016 1:17 pm

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

Post by TinCanTech » Thu Apr 05, 2018 12:54 pm

Read your log file ...

bernhard.muehlbauer@ulb.hhu.de
OpenVpn Newbie
Posts: 2
Joined: Thu Apr 05, 2018 11:55 am

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

Post by bernhard.muehlbauer@ulb.hhu.de » Mon Apr 09, 2018 9:22 am

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

Post Reply