DeeEnEs Alternative?

  • Hiho,

    kenne mich mit den internet-functions nicht so aus, aber wäre es möglich, eine DeeEnEs-Alternative zu coden?

    DeeEnEs wird dazu verwendet, die aktuelle IP-Adresse an DynDNS.org zu senden, um ständig über einen festen
    Host auf seinen Rechner @ Home zugreifen zu können.

    Leider funzt DeeEnEs bei mir unter Vista nicht mehr, ich hab ka wodran es liegt. Andere gute Alternativen
    habe ich auch nicht finden können.

  • Jau möglich ist das ohne weiteres, hatte mir mal vor Jahren was zusammen gebaut in VB Script. Wenn ich mir die Url von pee ansehe und mal meine Birne anstrenge war das mit ein paar http links zu schaffen. Falls sonst keiner Lust hat, würde ich mich heute Abend mal dran setzen und was einfaches basteln, Oder besser probier mal nen bissel rum, ist doch mal ne nette Übung :)

    Einstiegsseite: Link
    Testaccount: Link

    Mfg
    Jens (McPoldy)

    Twitter: jkroeger

    Denn die Dinge, die wir erst lernen müssen, bevor wir sie tun, lernen wir beim Tun.(Aristoteles)

    Einmal editiert, zuletzt von McPoldy (15. April 2008 um 06:33)

  • Hi,

    also mein router kann das leider net, dafür ist der leider zu alt.
    mit den neuen clients läuft es schonmal besser ... damit werde ich dann die zeit überbrücken, bis was autoit-mäßiges vorliegt *g*

    also als erstes werde ich wohl die ip-funktion schreiben ... weil bei dem rest (einloggen, host auslesen, updaten) habe ich nock kein plan wie das geht.
    werde mir die seiten aber noch durchlesen, wobei engl. nicht wirklich meine stärke ist ;)

  • Ist doch einfach :) Der Anfang:

    Spoiler anzeigen
    [autoit]

    $host = "test.shacknet.nu"
    $user = "test"
    $pass = "test"
    $wildcard = "NOCHG" ;ON should be used to enable wildcard. NOCHG value will keep current wildcard settings. Any other value will disable wildcard for hosts in update.

    [/autoit] [autoit][/autoit] [autoit]

    #include <Inet.au3>
    $oldIP = iniRead("auDNS.ini","SETTINGS","LastIP","")
    $IP = _GETIP()
    If $oldIP <> $IP THen
    $return = _InetGETSOURCE("http://"&$user&":"&$pass&"@members.dyndns.org/nic/update?hostname="&$host&"&myip="&$IP&"&wildcard="&$wildcard&"&mx=NOCHG&backmx=NOCHG")
    IniWrite("auDNS.ini","SETTINGS","LastIP",$IP)
    MsgBox(0,"Return-Code",$return)
    EndIf

    [/autoit]
  • So mein Beispiel ist auch fertig und getestet:

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.2.10.0
    Author: J. Kröger (McPoldy)

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Update von dyndns Accounts

    [/autoit] [autoit][/autoit] [autoit]

    Beispiel INI Datei:

    [settings]
    dyndnsurl=test.dyndns.org
    dyndnsuser=test
    dyndnspassword=test
    updateintervall=10
    updateserver=members.dyndns.org
    updateport=80
    #ce ----------------------------------------------------------------------------
    TraySetIcon("Shell32.dll",23)
    TCPStartup()
    #include <Inet.au3>
    #include <IE.au3>
    #include <_Base64.au3>
    #include <array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Local $dyndnsurl = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','dyndnsurl','ka')
    Local $dyndnsuser = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','dyndnsuser','ka')
    Local $dyndnspassword = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','dyndnspassword','ka')
    Local $updateintervall = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','updateintervall','10')
    Local $updateserver = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','updateserver','members.dyndns.org')
    Local $updateserverIP = TCPNameToIP($updateserver)
    Local $updateport = IniRead(@ScriptDir & '\dyndnsUpdate.ini','settings','updateport','80')

    [/autoit] [autoit][/autoit] [autoit]

    Local $CurrentPublicIP
    Local $CurrentDynDnsIP
    Local $IpDiff = True

    [/autoit] [autoit][/autoit] [autoit]

    Local $conSocket = -1
    Local $reciv
    Local $send
    Local $result

    [/autoit] [autoit][/autoit] [autoit]

    _StartUpdate()
    While 1
    Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _StartUpdate()
    _Main()
    AdlibEnable("_Main",$updateintervall * 60 * 1000)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()
    _GetIPs()
    If $IpDiff = False then
    _Update()
    if $result <> "ka" Then
    Switch StringStripWS($result,8)
    Case "badauth"
    TrayTip("badauth","The username and password pair do not match a real user.",10)
    Case "!donator"
    TrayTip("!donator","An option available only to credited users (such as offline URL) was specified, but the user is not a credited user. " & @LF & "If multiple hosts were specified, only a single !donator will be returned.",10)
    Case "good"
    TrayTip("good","The update was successful, and the hostname is now updated.",10)
    Case "nochg"
    TrayTip("nochg","The update changed no settings, and is considered abusive. Additional nochg updates will cause the hostname to become blocked.",10)
    Case "notfqdn"
    TrayTip("notfqdn","The hostname specified is not a fully-qualified domain name (not in the form hostname.dyndns.org or domain.com).",10)
    Case "nohost"
    TrayTip("nohost","The hostname specified does not exist in this user account (or is not in the service specified in the system parameter)",10)
    Case "numhost"
    TrayTip("numhost","Too many hosts (more than 20) specified in an update. Also returned if trying to update a round robin (which is not allowed)",10)
    Case "abuse"
    TrayTip("abuse","The hostname specified is blocked for update abuse.",10)
    Case "badagent"
    TrayTip("badagent","The user agent was not sent or HTTP method is not permitted (we recommend use of GET request method).",10)
    Case Else
    TrayTip("DynDnsUpdater","Update abgeschlossen auf IP: " & $CurrentPublicIP,10)
    EndSwitch
    EndIf
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetIPs()
    $CurrentPublicIP = _GetIP()
    $CurrentDynDnsIP = TCPNameToIP($dyndnsurl)
    $IpDiff = ($CurrentDynDnsIP = $CurrentPublicIP)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    $result = "ka"

    Dim $strUrl = StringFormat("http://%s:%[email='s@members.dyndns.org'][/email]/nic/update?hostname=%s&myip=%s&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG",$dyndnsuser,$dyndnspassword,$dyndnsurl,$CurrentPublicIP)

    [/autoit] [autoit][/autoit] [autoit]

    $send = "GET /nic/update?hostname=" & $dyndnsurl & "&myip=" & $CurrentPublicIP & "&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG HTTP/1.0"
    $send &= "Host: members.dyndns.org" & @CRLF
    $send &= "Authorization:Basic " & _Base64Encode(StringFormat("%s:%s",$dyndnsuser,$dyndnspassword),False) & @CRLF
    $send &= "User-Agent: Company - Device - Version Number" & @CRLF
    $send &= @CRLF

    [/autoit] [autoit][/autoit] [autoit]

    $conSocket= TCPConnect($updateserverIP,$updateport)
    If Not @error Then
    TCPSend($conSocket,$send)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $reciv = TCPRecv($conSocket,2048)
    If $reciv <> "" Then
    $result = StringSplit($reciv,@CRLF)
    if isarray($result) then $result = $result[$result[0]]
    ExitLoop
    EndIf
    WEnd
    EndIf
    return $result
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]