Piratpartiets mötesplattform


Svara
 
Ämnesverktyg Sök i det här ämnet Visningsalternativ
  (#1) Gammal
the5cardstud Inte uppkopplad
 
Inlägg: 2
Reg.datum: May 2007
Standard Batch file to monitor Relakks connection and reconnect if needed - 2007-05-04, 21:24

I have created a batch file that connects me to Relakks and keeps me connected. If my connection dies (but stays connected), or if it disconnects, it reconnects. It does not take many cycles to run and is bandwidth friendly to the Relakks server.



I use it on Windows XP Professional. I do not know if it needs to be modified for other Windows versions.



This is C:\Documents and Settings\Username\Start Menu\Programs\Startup\stayrelakksed.bat



@ECHO OFF

SETLOCAL

REM ----------- USER PARAMETERS - MODIFY THESE TO SUIT YOUR NEEDS -----------

REM

REM NOTICE - YOU MUST CHANGE THE FIRST THREE VALUES TO MATCH YOUR ACCOUNT



REM change VPNNAME to the name of the Connectoid in Network Connections

SET VPNNAME=Relakks



REM change RELAKKSUSER to your username on the Relakks system

SET RELAKKSUSER=username



REM change RELAKKSPASS to your password on the Relakks system

SET RELAKKSPASS=password



REM -- USUALLY NO NEED TO MODIFY ANYTHING BELOW THIS LINE UNLESS DEBUGGING ---



REM if you want to see every command and its output, set DEBUG to TRUE

SET DEBUG=FALSE



REM if the Relakks boundary gateway changes, use tracert to find it and

REM then set PINGBOUNDARY to the new address

SET PINGBOUNDARY=83.233.182.2



REM if you only want to see required error messages then set QUIET to TRUE

SET QUIET=FALSE



REM --- END OF USER PARAMETERS-NO NEED TO MODIFY ANYTHING BELOW THIS LINE ----

SET OUTPUT=NUL

IF %DEBUG%==TRUE SET OUTPUT=CON

IF %DEBUG%==TRUE ECHO ON



IF %QUIET%==FALSE ECHO %DATE% %TIME% %0 running for %VPNNAME%

:startloop



:testboundary

ping -i 4 -n 2 %PINGBOUNDARY% | FIND "Reply from %PINGBOUNDARY%" > %OUTPUT%

IF ERRORLEVEL 1 GOTO :testfail



:sleep

REM -- sleeping for a brief period

ping -n 15 localhost > %OUTPUT%

goto :startloop



:testfail

IF %QUIET%==FALSE ECHO %DATE% %TIME% Connection to %VPNNAME% is not alive



:rasdial

IF %QUIET%==FALSE ECHO %DATE% %TIME% Dialing the %VPNNAME% connection

RASDIAL /D > %OUTPUT%

RASDIAL %VPNNAME% %RELAKKSUSER% %RELAKKSPASS% > %OUTPUT%

IF ERRORLEVEL 1 goto :rasfail

IF %QUIET%==FALSE ECHO %DATE% %TIME% Connection to %VPNNAME% established

goto :testboundary



:rasfail

ECHO %DATE% %TIME% Error %ERRORLEVEL% - retrying in 10 seconds - Ctrl-C to interrupt

ping -n 10 localhost > %OUTPUT%

goto :rasdial



:end



ENDLOCAL




   
Svara med citat
Svara

Ämnesverktyg Sök i det här ämnet
Sök i det här ämnet:

Avancerad sökning
Visningsalternativ

Regler för att posta
Du får inte posta nya ämnen
Du får inte posta svar
Du får inte posta bifogade filer
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG]-kod är
HTML-kod är av


Liknande ämnen
Ämne Startat av Forum Svar Senaste inlägg
Brainstorming needed macomar Affischer, flyers, klistermärken osv. 7 2009-05-28 13:01
Relakks batch file connection problem? randomjester In English 0 2008-10-12 02:32
Relakks dies when connection exeeds 100-200kbps johnnybs Relakks 0 2007-09-27 15:46
PPTP Connection dying with Error 800 wursti Relakks 0 2007-02-18 22:28
Software Developed to Monitor Opinions of U.S. Celebrandil PP i media 14 2006-10-08 20:05



Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson
vBulletin Skin developed by: vBStyles.com