Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Speicherverbrauch von ddclient
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
l3u
Advocate
Advocate


Joined: 26 Jan 2005
Posts: 2545
Location: Konradsreuth (Germany)

PostPosted: Thu Sep 11, 2008 2:06 pm    Post subject: Speicherverbrauch von ddclient Reply with quote

Hi :-)

Ich habe drei DynDNS-Domains, die auf meine NSLU2 zeigen. Das Ding hat ja nur 32 MB Arbeitsspeicher, also muß man damit ein bißchen haushalten. Derzeit verwende ich ddclient, um die Domains zu aktualisieren. Der ddclient sitzt allerdings mit fetten 4 MB im Speicher, dafür, daß er ein einziges Mal am Tag effektiv was tut. Wär es nicht sinnvoller, wenn man nen Cronjob machen würde, der alle 5 Minuten die IP nachschaut (was ddclient auch macht), und dann ddclient nicht als Daemon, sondern ein mal startet, um die IP zu aktualisieren? Oder braucht das dann noch mehr Speicher?

MfG, Libby
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Sep 11, 2008 10:20 pm    Post subject: Reply with quote

sofern du wget installiert hast kannst du das Update auch so machen:
Code:
#!/bin/bash
fqdn=<dein dyndns name>
user=<dein dyndns user>
pass=<dein dyndns passwors>

alt=`dig +short $fqdn`
neu=`wget -qO - http://checkip.dyndns.org/index.html sed 's/.*Address: \([0-9\.]*\)<.*/\1/'`

if [ $alt = $neu ];
then
 echo "nix zu tun";
else
 echo `wget -q0 - http://$user:$pass@members.dyndns.org/nic/update?hostname=$fqdn | awk {'print $2'}`
fi

_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
l3u
Advocate
Advocate


Joined: 26 Jan 2005
Posts: 2545
Location: Konradsreuth (Germany)

PostPosted: Fri Sep 12, 2008 11:02 am    Post subject: Reply with quote

Cool, danke! Verbunden mit nem cleveren Cronjob ist das definitiv die weniger speicherhungrige Variante. Und man kann den ganzen Kram ja auch schön loggen. Super :-)
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Fri Sep 12, 2008 3:26 pm    Post subject: Reply with quote

Sollte eigentlich auch ohne CRON gehen. Die Scripte im Ordner "/etc/ppp/ip-up.d/" werden ausgeführt nach dem PPP neu verbunden hat.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
l3u
Advocate
Advocate


Joined: 26 Jan 2005
Posts: 2545
Location: Konradsreuth (Germany)

PostPosted: Fri Sep 12, 2008 4:39 pm    Post subject: Reply with quote

Der Server stellt aber nicht selber die Internetverbindung her, der hängt nur als Client an einer Fritz-Box. Da bleibt mir doch nichts anderes übrig, als immer mal nachzuschauen, ob die Fritz-Box immer noch die selbe IP hat, oder?

Also derzeit mach ich das so:

Crontab:
Code:
*/15 0-2,6-23 * * * root check_ip
*/5  3,5      * * * root check_ip
*    4        * * * root check_ip

(die Fritz-Box sollte eine Trennung und Neueinwahl zwischen 4 und 5 machen)

check_ip:
Code:
#!/bin/bash

IP_FILE="/var/tmp/ip"
GET_IP="/usr/local/sbin/get_fritz_ip"
UPDATE_DYNDNS="/usr/local/sbin/update_dyndns"

if [[ ! -e "$IP_FILE" ]]; then
        echo "0.0.0.0" > "$IP_FILE"
fi

currentIp=$($GET_IP)
oldIp=$(cat "$IP_FILE")

if [[ "$oldIp" != "$currentIp" ]]; then
        echo "$currentIp" > "$IP_FILE"
        logger -t "check_ip" "IP changed from $oldIp to $currentIp. Starting update ..."
        $UPDATE_DYNDNS
fi


get_fritz_ip hab ich online gestellt

und schließlich noch update_dyndns:
Code:
#!/bin/bash

DOMAINS="
        meine-domains.de
        ...
"
PASSWORD="geheim!"

for DOMAIN in $DOMAINS; do
        STATUS=$(wget -q "https://$DOMAIN:$PASSWORD@dyndns.strato.com/nic/update?hostname=$DOMAIN" -O /dev/stdout)
        logger -t "update_dyndns" "Updating $DOMAIN: $STATUS"
done
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum