1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 config_get service "$section" service
8 config_get username "$section" username
9 config_get password "$section" password
10 config_get host "$section" host
11 config_get update "$section" update
13 [ "$update" = 1 ] && {
14 if [ "$service" = "dyndns" ]; then
15 wget http://checkip.dyndns.org -O /tmp/updatedd_ip_check
16 current_ip=`cat /tmp/updatedd_ip_check |cut -d':' -f2|cut -d'<' -f1 |cut -d' ' -f2`
17 rm /tmp/updatedd_ip_check
18 old_ip=`nslookup "$host" |grep "$host" -A 1 |grep Address |cut -d' ' -f3`
19 if [ "$current_ip" = "$old_ip" ]; then
20 echo "Preventing abusive update"
24 if [ "$abusive" != "1" ]; then
25 /usr/bin/updatedd -Y $service -- $username:$password $host
31 config_load "updatedd"
32 config_foreach start_service updatedd