Am 16.05.2013 21:20, schrieb Sascha Reißner:
> Am Donnerstag, den 16.05.2013, 12:55 +0200 schrieb Rico Pietzsch:
>> Hallo,
>>
>> ich denke das ich hier nicht der einzige dyndns.org Nutzer bin.
>> Man soll sich wohl nun einmal pro Monat auf dem Portal einloggen das der
>> kostenfreie Account nicht deaktiviert wird.
>>
>> Hat schon jemand eine Idee wie man mittels wget, curl oder ruby
>> mechanize automatisch bewerkstelligen könnte?
>>
>> der erste kurze Versuch mit
>> wget --user=NAME --password=PASSWORT http://account.dyn.com/entrance/
>> brachte zumindest keinen Erfolg
>
> Hab heute ein Script als quick&dirty-Lösung geschrieben.
> Per Hand aufgerufen funktioniert es.
> Ob es per Cron ebenfalls funktioniert, wird sich erst zeigen.
>
> ### begin dyndns-login.sh ###
> #!/bin/bash
>
> . /etc/ddclient.conf
>
> wget -O /tmp/login.html --save-cookies /tmp/cookies.txt https://account.dyn.com/entrance/
>
> found=0
> multi=''
> while read line; do
> if [ `egrep -c "<form id='login" <<< $line` -gt 0 ] ; then found=1; fi
> if [ `egrep -c "</form>" <<< ${line}` -gt 0 ]; then found=0; fi
> if [ `egrep -c "multiform" <<< ${line}` -gt 0 -a $found -eq 1 ]; then
> multi=`sed -e "s/.*value='\([[:alnum:]]*\)'.*/\1/" <<< ${line}`
> fi
> done < /tmp/login.html
>
> wget -O /tmp/account.html --load-cookies /tmp/cookies.txt --post-data="username=${login}&password=${password}&multiform=${multi}" https://account.dyn.com/entrance/
> sleep 2
> wget -O /tmp/logout.html --load-cookies /tmp/cookies.txt https://account.dyn.com/entrance/?__logout=1
> sleep 2
>
> #rm /tmp/login.html
> #rm /tmp/account.html
> #rm /tmp/logout.html
> #rm /tmp/cookies.txt
>
> exit 0
> ### end dyndns-login.sh ###
>
> Die unteren 4 Zeilen mit 'rm' sind noch auskommentiert, da ich damit
> prüfen kann ob alles geklappt hat.
> Wie gesagt, quick&dirty, kann sicherlich noch verbessert oder optimiert
> werden.
>
Hallo,
quick und dirty ging leider bei mir nicht .... aber ...
ich habe gerade einen Skript im synology Forum entdeckt der das ganze
mit python löst:
http://www.synology-forum.de/showthread.html?41476-Neue-SLA-bei-kostenlosen-Dyndns-Accounts-mittels-AutoLoginScript-umgehen&p=335978&viewfull=1#post335978
Wenn man die Quelle in /usr/bin/python2.7 ändert und die überschüssigen
Tabs entfernt scheint es zu funktionieren.
Ich hab das mal nach Pastebin gelegt:
http://paste.debian.net/7034/
Wenn nicht erfährt man das ja nach spätestens 31 Tagen und muß mal per
Hand ran.
Grüße,
Rico
Attachment:
signature.asc
Description: OpenPGP digital signature