====== AutoIT Scripts ======
===== generate dynamic DNS entry with DTDNS.org =====
Download: executeable {{:sonstiges:dns-script.zip|}} (350KB)
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: M. Wolfgruber
Script Function:
generate dynamic DNS entry with DTDNS.org
using a configurable ini-file
using emergancy URL notfall.flnet.org as default to create ini-file
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#include
$sTimeStamp = @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC
$sURLo = "notfall.flnet.org"
$sPWo = "notfall"
$sCLIENTo = "dns-script"
Local Const $sFilePath = "dns-script.ini"
; Write the value of 'AutoIt' to the key 'Title' and in the section labelled 'General'.
IniWrite($sFilePath, "General", "TITLE", "dns-script.exe")
IniWrite($sFilePath, "General", "VERSION", "0.1")
IniWrite($sFilePath, "General", "AUTHOR", "M. Wolfgruber")
IniWrite($sFilePath, "General", "INFO", "http://www.600infos.de")
IniWrite($sFilePath, "General", "SERVER", "http://www.dtdns.com")
; Read the INI file
$sURL = IniRead($sFilePath, "dynamicDNS", "URL", $sURLo)
$sPW = IniRead($sFilePath, "dynamicDNS", "PW", $sPWo)
$sCLIENT = IniRead($sFilePath, "dynamicDNS", "CLIENT", $sCLIENTo)
;output for debug
; MsgBox(64,"dtdns.com","URL: " & @Tab & $sURL & @CRLF & "PW: " & @Tab & $sPW & @CRLF & "Client: " & @Tab & $sCLIENT & "_" & $sTimeStamp, 5 )
; Write INI file with used parameters
IniWrite($sFilePath, "dynamicDNS", "URL", $sURL)
IniWrite($sFilePath, "dynamicDNS", "PW", $sPW)
IniWrite($sFilePath, "dynamicDNS", "CLIENT", $sCLIENT)
; load dyndns URL
$sText = _INetGetSource("http://www.dtdns.com/autodns.cfm?id=" & $sURL & "&pw=" & $sPW & "&client=" & $sCLIENT & "_" & $sTimeStamp )
;output for debug
; ConsoleWrite($sText)
; MsgBox(64,"dtdns.com",$sText,5)
$sText2 = StringReplace(StringReplace($sText, @CR, ""), @LF, "")
IniWrite($sFilePath, "LOG", "lastAnswer", $sText2)
IniWrite($sFilePath, "LOG", "TimeStamp", $sTimeStamp)
IniWrite($sFilePath, "LOG", "lastRuntime", @MDAY & "." & @MON & "." & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC )
;EOF
===== Example INI-File =====
[General]
TITLE=dns-script.exe
VERSION=0.1
AUTHOR=M. Wolfgruber
INFO=http://www.600infos.de
SERVER=http://www.dtdns.com
[dynamicDNS]
URL=notfall.flnet.org
PW=notfall
CLIENT=dns-script
[LOG]
lastAnswer=Host notfall.flnet.org now points to 123.123.123.123.
TimeStamp=20100101_123456
lastRuntime=01.01.2010 12:34:56