0

After closing app script try to open it again. After oppening app and connecting to server script stops and nothing is continued.

:start
timeout /t 2
ping -n 1 10.0.0.1 | find "Reply" > nul
if errorlevel 1 goto OFF
goto start

:OFF
taskkill /F /IM openvpn-gui.exe 
taskkill /F /IM openvpn.exe
timeout /t 3
"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --connect pgp.ovpn 
goto start 

:end
double-beep
  • 5,031
  • 17
  • 33
  • 41
  • The code you have provided is a Windows batch-file. The question subject line has the word `bash` in it. `BASH` is a completely different scripting language. Please describe what `BASH` has to do with your `BATCH-FILE` code. – Squashman Dec 06 '18 at 02:18
  • Searching for `Reply` might give you false positives. [Better use ' TTL=` as search string](https://stackoverflow.com/a/47397999/2152082) (As a bonus, it makes it language independent) – Stephan Dec 16 '18 at 17:14

0 Answers0