 |
AutoHotkey Community Wir helfen uns gegenseitig aus der Patsche
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
Ripp3r]D3[ Gast
|
Verfasst am: Mi Sep 19, 2007 4:10 pm Titel: Router Reconnect over Telnet |
|
|
Hir habe ich mal ein kleines Prog zum reconnecten von routern über telnet geschrieben hoffe es wird auch euch helfen.Viel spaß mit meinem Prog!!!
Hier Downloaden
ripper122.ja-nee.de
Source:
| Code: |
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
URLDownloadToFile,http://www.wieistmeineip.de/,ipaddress.txt
FileReadLine,ipaddress,ipaddress.txt,144
start:=InStr(ipaddress,"<h1 class=")+15
length:=InStr(ipaddress,"</h1>")-start
StringMid,ipaddress,ipaddress,%start%,%length%
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
IniRead, Router, %A_ScriptDir%\Config.ini, Config, adr,fritz.box
IniRead, Pwd, %A_ScriptDir%\Config.ini, Config, Pwd,123
IniRead, slpCMD, %A_ScriptDir%\Config.ini, Config, slpCMD,1000
IniRead, slpPW, %A_ScriptDir%\Config.ini, Config, slpPW,1000
IniRead, CMD, %A_ScriptDir%\Config.ini, Config, CMD,ar7cfgchanged
Gui, Add, Edit, x6 y10 w330 h200 vMyText ReadOnly , Edit
Gui, Add, Button, x6 y250 w100 h30 , Reconnect
Gui, Add, Button, x126 y250 w100 h30 , Configure
Gui, Add, Button, x236 y250 w100 h30 , About
Gui, Add, Progress, x6 y210 w330 h20 vMyProgress, 0
Gui, Show, x0 y0 h293 w345, Reconnect over Telnet
start1:
IfExist,ipaddress.txt
FileDelete,ipaddress.txt
FileRead,TxtIni,Readme.txt
GuiControl,, MyText,Your Web-IP is %ipaddress% ......Pleas wait 5sec!!!
Sleep,5000
GuiControl,, MyText,Your Web-IP is %ipaddress%`r`n%TxtIni%
GuiControl,, MyProgress, 0
Return
start:
return
GuiClose:
ExitApp
ButtonReconnect:
GuiControl,, MyText,%ipaddress%
Run,%comspec% /c telnet %Router%,,,winID
GuiControl,, MyText, The Telnet client connect to the Router
GuiControl,, MyProgress, 30
sleep,%slpPW%
Send,%Pwd%
GuiControl,, MyText,Password input
GuiControl,, MyProgress, 50
sleep,%slpPW%
Send,{Enter}
GuiControl,, MyText, Send a Enter
GuiControl,, MyProgress, 70
sleep,%slpCMD%
Send,%CMD%
GuiControl,, MyText, Send the Reconnect/Reboot COMMAND
GuiControl,, MyProgress, 90
sleep,%slpPW%
Send,{Enter}
GuiControl,, MyText, Send a Enter
GuiControl,, MyProgress, 100
sleep,%slpCMD%
sleep,%slpCMD%
Send,exit
sleep,%slpPW%
Send,{Enter}
Gui, Show, x0 y0 h293 w345, Reconnect over Telnet
Loop 6
{
Gui Flash
Sleep 500
}
GuiControl,, MyText, Close the CMD
Msgbox,In round 60sec you are Online and you become to see your new IP.
GuiControl,, MyText, Wait for Web...
Sleep,60000
URLDownloadToFile,http://www.wieistmeineip.de/,ipaddress.txt
FileReadLine,ipaddress,ipaddress.txt,144
start:=InStr(ipaddress,"<h1 class=")+15
length:=InStr(ipaddress,"</h1>")-start
StringMid,ipaddress,ipaddress,%start%,%length%
Msgbox,%ipaddress%.
IfExist,ipaddress.txt
FileDelete,ipaddress.txt
goto start1
sleep,60000
URLDownloadToFile,http://www.wieistmeineip.de/,ipaddress.txt
FileReadLine,ipaddress,ipaddress.txt,144
start:=InStr(ipaddress,"<h1 class=")+15
length:=InStr(ipaddress,"</h1>")-start
StringMid,ipaddress,ipaddress,%start%,%length%
Msgbox,%ipaddress%. If you can´t see a new IP wait a second time 60sec Pleas.
GuiControl,, MyText,%ipaddress%
IfExist,ipaddress.txt
FileDelete,ipaddress.txt
goto start1
sleep,60000
URLDownloadToFile,http://www.wieistmeineip.de/,ipaddress.txt
FileReadLine,ipaddress,ipaddress.txt,144
start:=InStr(ipaddress,"<h1 class=")+15
length:=InStr(ipaddress,"</h1>")-start
StringMid,ipaddress,ipaddress,%start%,%length%
Msgbox,%ipaddress%.
IfExist,ipaddress.txt
FileDelete,ipaddress.txt
goto start1
GuiControl,, MyText, Now you must be Reconnect or anything is run wrong.
return
ButtonConfigure:
InputBox, Inadr , Router, Pleas input your Router address!!!,,,,,,,,fritz.box
if ErrorLevel
goto start
IniWrite, %Inadr%, %A_ScriptDir%\Config.ini, Config, adr
InputBox, InPwd , Password, Pleas input your Password for your Router!!!, HIDE,,,,,,,123
if ErrorLevel
goto start
IniWrite, %InPwd%, %A_ScriptDir%\Config.ini, Config, Pwd
InputBox, 1InCMD , Command, Pleas chous a COMMAND for the reboot!!!,,,,,,,,1
if ErrorLevel
goto start
if 1InCMD=1
{
InCMD=ar7cfgchanged
}
if 1InCMD=2
{
InCMD=dsld -s && dsld -i -n
}
if 1InCMD=3
{
InCMD=reboot
}
IniWrite, %InCMD%, %A_ScriptDir%\Config.ini, Config, CMD
InputBox, InslpPW , Sleep, Pleas input the waiting time to enter the PW 1000=1sec!!!,,,,,,,,1000
if ErrorLevel
goto start
IniWrite, %InslpPW%, %A_ScriptDir%\Config.ini, Config, slpPW
InputBox, InslpCMD , Sleep, Pleas input the waiting time to enter the COMMAND 1000=1sec!!!,,,,,,,,3000
if ErrorLevel
goto start
IniWrite, %InslpCMD%, %A_ScriptDir%\Config.ini, Config, slpCMD
return
ButtonAbout:
FileRead,About,%A_ScriptDir%\source\about.sys
FileRead,source,%A_ScriptDir%\source\reconnect.ahk
GuiControl,, MyText,%About%`r`n%source%
return
|
Moderator AGermanUser: URL repariert. |
|
| Nach oben |
|
 |
msgbox
Anmeldedatum: 05.05.2007 Beiträge: 778 Wohnort: C:\
|
Verfasst am: Mi Sep 19, 2007 5:50 pm Titel: |
|
|
Hört sich irgenwie nach Rapidshare an  _________________
msgbox, 1577008, Ich bin msgbox, Teste mich mal |
|
| Nach oben |
|
 |
Lirave Gast
|
Verfasst am: Mi Sep 19, 2007 9:01 pm Titel: |
|
|
funzt bei mir leider nicht, liegt es daran, dass ich bei Kabeldeutschland bin?
was müsste ich dann an deinem Proggi ändern? |
|
| Nach oben |
|
 |
IsNull
Anmeldedatum: 20.12.2006 Beiträge: 1326 Wohnort: CH
|
Verfasst am: Do Sep 20, 2007 5:37 am Titel: |
|
|
@Lirave:
Voraussetzung hier ist, dass du einen Remote - Control (telnet od. ä.) fähigen Router hast.
Am einfachsten ist es, wenn du das ganze erst manuell durchspielst:
CMD öffnen.
telnet [IP-des-Routers] [Connection-Port (standard 23)]
Reconnect Befehl.
Fertig.
so etwa deine eingaben:
| Zitat: | telnet 192.168.1.1 23
restart |
Das ganze dann mit ahk automatisieren, d.h. z.B. Send commands... _________________
http://securityvision.ch
www.forum.securityvision.ch |
|
| Nach oben |
|
 |
Lirave Gast
|
Verfasst am: Do Sep 20, 2007 11:10 am Titel: |
|
|
das klappt bei mir nicht, wenn ich ne neue ip haben will, dann gehe ich so vor:
als erstes steuer ich über meinen browser meinen kabelmodem an:
dort musss ich dann meine mac adresse ändern,
soweit könnte man das ja mit ahk programmieren.
Danach muss ich aber Hardware mäßig vorgehen, das heißt, zuerst musss ich meinen D-Link Router vom netzt nehmen, dann mein kabelmodem.
Dannn setzte ich mein kabelmodem wieder unter strom und warte ca ne minute, dann hatt er sich rekonfiguriert. Erst dann kann ich wieder meinen router anschließen und nach weitern 20 sec. bin ich mit ner neuen ip im netz.
ich weiß nicht, ob man das vom strom trennen mit autohotkey erreichen kann, und ob das überhaupt funktioniert, da die Verbindung von Telekom-Dose über Kabelmodem über D-Link Router zum Rechner, ja vom rechner aus gesteuert werden müsste.
Aber vlt. kann man das irgendwie timen |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Sep 20, 2007 11:40 am Titel: |
|
|
| Mit dem Rechner ein Infrarotsignal an ein mit Fernbedinung ansteuerbares Steckdosenadapter senden, über welches der Router mit Strom versorgt wird? Oder gibts ein Kommando um den Router zu reseten? |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Sep 20, 2007 11:42 am Titel: |
|
|
| btw. wofür der ganze Zinober? |
|
| Nach oben |
|
 |
Lirave Gast
|
Verfasst am: Do Sep 20, 2007 12:27 pm Titel: |
|
|
wie im 2. Post erwähnt^^
ja ist ein kleiner Grund, aber wenn es möglich ist, warum nicht |
|
| Nach oben |
|
 |
Obi-Wahn
Anmeldedatum: 19.04.2006 Beiträge: 736 Wohnort: Wien
|
Verfasst am: Do Sep 20, 2007 12:48 pm Titel: |
|
|
@liarve: reicht es nicht, dass du ren router neustartest? _________________ Garten ist eine Kunstnatur
Das Leben ist nicht fair. Es ist nur fairer als der Tod, das ist alles.
Obi-Wahns Codeschnipsel @ securityvision.ch |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Sep 20, 2007 1:02 pm Titel: |
|
|
| Zitat: | | reicht es nicht, dass du ren router neustartest? | Denke schon, oder ?! |
|
| Nach oben |
|
 |
halweg
Anmeldedatum: 05.01.2006 Beiträge: 872 Wohnort: Dresden
|
Verfasst am: Do Sep 20, 2007 1:51 pm Titel: |
|
|
| BoBo¨ hat Folgendes geschrieben: | | Mit dem Rechner ein Infrarotsignal an ein mit Fernbedinung ansteuerbares Steckdosenadapter senden, über welches der Router mit Strom versorgt wird? Oder gibts ein Kommando um den Router zu reseten? |
Es gibt wohl LAN-steuerbare Steckdosen. Die würden das ermöglichen.
Aber warum eigentlich so umständlich. Soweit ich weiß, hat ein DSL-Router ein einstellbares Timeout für das Verbindung abbrechen, damit holt er sich im Zweifelsfall ganz von selbst ne neue IP. An der Timeouteinstellung kann man auch ein reconnect erzwingen, was den Vorteil hat, dass das Netzwerk nicht zusammenbricht. |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Sep 20, 2007 2:04 pm Titel: |
|
|
| Goole: RapGet |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Sep 20, 2007 2:05 pm Titel: |
|
|
Hier noch das fehlende 'g'  |
|
| Nach oben |
|
 |
Ripp3r]D3[ Gast
|
Verfasst am: Do Sep 20, 2007 4:33 pm Titel: |
|
|
Also bei mir funtzt es eimandfrei habe eine FritzBox! und bei allen anderen routern mit telnet dürfte es auch gehen ihr müsst bloß den befehl von eurem router zum neustarten verwenden das könnt ihr ja konfigurieren wie im prog beschrieben.
Bei weiteren fragen schreibt einfach ne antwort. |
|
| Nach oben |
|
 |
IsNull
Anmeldedatum: 20.12.2006 Beiträge: 1326 Wohnort: CH
|
Verfasst am: Do Sep 20, 2007 5:42 pm Titel: |
|
|
Wow, danke BoBo... von dem Ding habe ich noch nie was gehört. Aber es läuft super.
Um den automatischen Routerreconnect zu erreichen, kann man einfach unter Settings/Sheduler den Event "After every Download" das "Run Programm" ausführen lassen.
Und dort hin setzt man dann seinen Router Reconnector.
Gruss
IsNull _________________
http://securityvision.ch
www.forum.securityvision.ch |
|
| Nach oben |
|
 |
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten.
|
Powered by phpBB © 2001, 2005 phpBB Group Deutsche Übersetzung von phpBB.de
|