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