View previous topic :: View next topic |
Author |
Message |
l3u Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/535570295dff893c1fda6.png)
Joined: 26 Jan 2005 Posts: 2616 Location: Konradsreuth (Germany)
|
Posted: Thu Sep 11, 2008 2:06 pm Post subject: Speicherverbrauch von ddclient |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Thu Sep 11, 2008 10:20 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
l3u Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/535570295dff893c1fda6.png)
Joined: 26 Jan 2005 Posts: 2616 Location: Konradsreuth (Germany)
|
Posted: Fri Sep 12, 2008 11:02 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Anarcho Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/1030393113423afb9086043.jpg)
Joined: 06 Jun 2004 Posts: 2970 Location: Germany
|
Posted: Fri Sep 12, 2008 3:26 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
l3u Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/535570295dff893c1fda6.png)
Joined: 26 Jan 2005 Posts: 2616 Location: Konradsreuth (Germany)
|
Posted: Fri Sep 12, 2008 4:39 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|