瀏覽代碼

ddns-scripts: rollup to version 2.5.0-1

- add -V / --version parameter to show version information
- new option lookup_host as host to use by nslookup/host to validate IP address changes, to be separate from [DOMAIN] parameter which produces a lot of questions in the forum and on multi-host updates
- new option param_enc for optional usage inside update_url [PARAMENC] (will be send urlencoded)
- new option param_opt for optional usage inside update_url [PARAMOPT]
- new service strato.de (IPv4 only) requested by ludwig.jaffe@
- new service variomedia.de (IPv4 & IPv6) requested by Wolfgang Oertl #1884
- rewritten function get_service_data to read services/service_ipv6 file
- allow 3rd parameter inside services/service_ipv6 file - here should be the answer of the ddns provider on success. If parameter is set, it's checked by ddns-scripts and report errors to logfile/syslog if failed and retry
- updated tld_names.dat

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Christian Schoenebeck 9 年之前
父節點
當前提交
7ea8be0b0d

+ 2
- 2
net/ddns-scripts/Makefile 查看文件

@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
9 9
 PKG_NAME:=ddns-scripts
10 10
 # Version == major.minor.patch
11 11
 # increase on new functionality (minor) or patches (patch)
12
-PKG_VERSION:=2.4.3
12
+PKG_VERSION:=2.5.0
13 13
 # Release == build
14 14
 # increase on changes of services files or tld_names.dat
15
-PKG_RELEASE:=2
15
+PKG_RELEASE:=1
16 16
 
17 17
 PKG_LICENSE:=GPL-2.0
18 18
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>

+ 3
- 2
net/ddns-scripts/files/ddns.config 查看文件

@@ -1,6 +1,5 @@
1 1
 #
2
-# Please read ddns.sample
3
-# or http://wiki.openwrt.org/doc/uci/ddns
2
+# Please read http://wiki.openwrt.org/doc/uci/ddns
4 3
 #
5 4
 config ddns "global"
6 5
 	option date_format "%F %R"
@@ -12,6 +11,7 @@ config ddns "global"
12 11
 
13 12
 config service "myddns_ipv4"
14 13
 	option service_name	"dyndns.com"
14
+	option lookup_host	"yourhost.example.com"
15 15
 	option domain		"yourhost.example.com"
16 16
 	option username		"your_username"
17 17
 	option password		"your_password"
@@ -21,6 +21,7 @@ config service "myddns_ipv4"
21 21
 
22 22
 config service "myddns_ipv6"
23 23
 	option update_url	"http://[USERNAME]:[PASSWORD]@your.provider.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
24
+	option lookup_host	"yourhost.example.com"
24 25
 	option domain		"yourhost.example.com"
25 26
 	option username		"your_username"
26 27
 	option password		"your_password"

+ 41
- 39
net/ddns-scripts/files/dynamic_dns_functions.sh 查看文件

@@ -29,6 +29,7 @@
29 29
 . /lib/functions/network.sh
30 30
 
31 31
 # GLOBAL VARIABLES #
32
+VERSION="2.5.0-1"
32 33
 SECTION_ID=""		# hold config's section name
33 34
 VERBOSE_MODE=1		# default mode is log to console, but easily changed with parameter
34 35
 
@@ -53,6 +54,9 @@ LOCAL_IP=""		# holds the local IP read from the box
53 54
 
54 55
 URL_USER=""		# url encoded $username from config file
55 56
 URL_PASS=""		# url encoded $password from config file
57
+URL_PENC=""		# url encoded $param_enc from config file
58
+
59
+SRV_ANSWER=""		# Answer given by service on success
56 60
 
57 61
 ERR_LAST=0		# used to save $? return code of program and function calls
58 62
 ERR_UPDATE=0		# error counter on different local and registered ip
@@ -299,40 +303,38 @@ urlencode() {
299 303
 # file /usr/lib/ddns/services_ipv6 for IPv6
300 304
 # $1	Name of Variable to store url to
301 305
 # $2	Name of Variable to store script to
306
+# $3	Name of Variable to store service answer to
302 307
 get_service_data() {
303
-	local __LINE __FILE __NAME __URL __SERVICES __DATA
304
-	local __SCRIPT=""
305
-	local __OLD_IFS=$IFS
306
-	local __NEWLINE_IFS='
307
-' # __NEWLINE_IFS
308
-	[ $# -ne 2 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters"
308
+	[ $# -ne 3 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters"
309 309
 
310 310
 	__FILE="/usr/lib/ddns/services"					# IPv4
311 311
 	[ $use_ipv6 -ne 0 ] && __FILE="/usr/lib/ddns/services_ipv6"	# IPv6
312 312
 
313
-	# remove any lines not containing data, and then make sure fields are enclosed in double quotes
314
-	__SERVICES=$(cat $__FILE | grep "^[\t ]*[^#]" | \
315
-		awk ' gsub("\x27", "\"") { if ($1~/^[^\"]*$/) $1="\""$1"\"" }; { if ( $NF~/^[^\"]*$/) $NF="\""$NF"\""  }; { print $0 }')
316
-
317
-	IFS=$__NEWLINE_IFS
318
-	for __LINE in $__SERVICES; do
319
-		# grep out proper parts of data and use echo to remove quotes
320
-		__NAME=$(echo $__LINE | grep -o "^[\t ]*\"[^\"]*\"" | xargs -r -n1 echo)
321
-		__DATA=$(echo $__LINE | grep -o "\"[^\"]*\"[\t ]*$" | xargs -r -n1 echo)
322
-
323
-		if [ "$__NAME" = "$service_name" ]; then
324
-			break			# found so leave for loop
313
+	# workaround with variables; pipe create subshell with no give back of variable content
314
+	mkfifo pipe_$$
315
+	# only grep without # or whitespace at linestart | remove "
316
+#	grep -v -E "(^#|^[[:space:]]*$)" $__FILE | sed -e s/\"//g > pipe_$$ &
317
+	sed '/^#/d/^[ \t]*$/ds/\"//g' $__FILE  > pipe_$$ &
318
+
319
+	while read __SERVICE __DATA __ANSWER; do
320
+		if [ "$__SERVICE" = "$service_name" ]; then
321
+			# check if URL or SCRIPT is given
322
+			__URL=$(echo "$__DATA" | grep "^http")
323
+			[ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA"
324
+
325
+			eval "$1=\"$__URL\""
326
+			eval "$2=\"$__SCRIPT\""
327
+			eval "$3=\"$__ANSWER\""
328
+			rm pipe_$$
329
+			return 0
325 330
 		fi
326
-	done
327
-	IFS=$__OLD_IFS
331
+	done < pipe_$$
332
+	rm pipe_$$
328 333
 
329
-	# check if URL or SCRIPT is given
330
-	__URL=$(echo "$__DATA" | grep "^http")
331
-	[ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA"
332
-
333
-	eval "$1=\"$__URL\""
334
-	eval "$2=\"$__SCRIPT\""
335
-	return 0
334
+	eval "$1=\"\""	# no service match clear variables
335
+	eval "$2=\"\""
336
+	eval "$3=\"\""
337
+	return 1
336 338
 }
337 339
 
338 340
 # Calculate seconds from interval and unit
@@ -793,19 +795,19 @@ send_update() {
793 795
 		local __URL __ERR
794 796
 
795 797
 		# do replaces in URL
796
-		__URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
797
-					       -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
798
+		__URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$URL_USER#g"	-e "s#\[PASSWORD\]#$URL_PASS#g" \
799
+					       -e "s#\[PARAMENC\]#$URL_PENC#g"	-e "s#\[PARAMOPT\]#$param_opt#g" \
800
+					       -e "s#\[DOMAIN\]#$domain#g"	-e "s#\[IP\]#$__IP#g")
798 801
 		[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
799 802
 
800 803
 		do_transfer "$__URL" || return 1
801 804
 
802 805
 		write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
803 806
 
804
-		return 0
805
-		# TODO analyze providers answer
806
-		# "good" or "nochg"		= dyndns.com compatible API
807
-		# grep -i -E "good|nochg" $DATFILE >/dev/null 2>&1
808
-		# return $?	# "0" if found
807
+		[ -z "$SRV_ANSWER" ] && return 0	# not set then ignore
808
+
809
+		grep -i -E "$SRV_ANSWER" $DATFILE >/dev/null 2>&1
810
+		return $?	# "0" if found
809 811
 	fi
810 812
 }
811 813
 
@@ -943,13 +945,13 @@ get_registered_ip() {
943 945
 		fi
944 946
 		[ $force_dnstcp -eq 1 ] && __PROG="$__PROG -T"	# force TCP
945 947
 
946
-		__RUNPROG="$__PROG $domain $dns_server >$DATFILE 2>$ERRFILE"
948
+		__RUNPROG="$__PROG $lookup_host $dns_server >$DATFILE 2>$ERRFILE"
947 949
 		__PROG="BIND host"
948 950
 	elif [ -x /usr/bin/nslookup ]; then	# last use BusyBox nslookup
949 951
 		[ $force_ipversion -ne 0 -o $force_dnstcp -ne 0 ] && \
950 952
 			write_log 14 "Busybox nslookup - no support to 'force IP Version' or 'DNS over TCP'"
951 953
 
952
-		__RUNPROG="/usr/bin/nslookup $domain $dns_server >$DATFILE 2>$ERRFILE"
954
+		__RUNPROG="/usr/bin/nslookup $lookup_host $dns_server >$DATFILE 2>$ERRFILE"
953 955
 		__PROG="BusyBox nslookup"
954 956
 	else	# there must be an error
955 957
 		write_log 12 "Error in 'get_registered_ip()' - no supported Name Server lookup software accessible"
@@ -981,16 +983,16 @@ get_registered_ip() {
981 983
 		[ -n "$2" ] && return $__ERR		# $2 is given -> no retry
982 984
 		[ $VERBOSE_MODE -gt 1 ] && {
983 985
 			# VERBOSE_MODE > 1 then NO retry
984
-			write_log 4 "Get registered/public IP for '$domain' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
986
+			write_log 4 "Get registered/public IP for '$lookup_host' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
985 987
 			return $__ERR
986 988
 		}
987 989
 
988 990
 		__CNT=$(( $__CNT + 1 ))	# increment error counter
989 991
 		# if error count > retry_count leave here
990 992
 		[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
991
-			write_log 14 "Get registered/public IP for '$domain' failed after $retry_count retries"
993
+			write_log 14 "Get registered/public IP for '$lookup_host' failed after $retry_count retries"
992 994
 
993
-		write_log 4 "Get registered/public IP for '$domain' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
995
+		write_log 4 "Get registered/public IP for '$lookup_host' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
994 996
 		sleep $RETRY_SECONDS &
995 997
 		PID_SLEEP=$!
996 998
 		wait $PID_SLEEP	# enable trap-handler

+ 2
- 2
net/ddns-scripts/files/dynamic_dns_lucihelper.sh 查看文件

@@ -33,7 +33,7 @@ __RET=0
33 33
 case "$1" in
34 34
 	get_registered_ip)
35 35
 		local IP
36
-		domain=$2			# Hostname/Domain
36
+		lookup_host=$2			# FQDN of host registered at DDNS
37 37
 		use_ipv6=${3:-"0"}		# Use IPv6 - default IPv4
38 38
 		force_ipversion=${4:-"0"}	# Force IP Version - default 0 - No
39 39
 		force_dnstcp=${5:-"0"}		# Force TCP on DNS - default 0 - No
@@ -99,4 +99,4 @@ esac
99 99
 # remove out and err file
100 100
 [ -f $DATFILE ] && rm -f $DATFILE
101 101
 [ -f $ERRFILE ] && rm -f $ERRFILE
102
-return $__RET
102
+return $__RET

+ 40
- 10
net/ddns-scripts/files/dynamic_dns_updater.sh 查看文件

@@ -22,9 +22,14 @@
22 22
 # variables in big chars beginning with "__" are local defined inside functions only
23 23
 # set -vx  	#script debugger
24 24
 
25
+. /usr/lib/ddns/dynamic_dns_functions.sh	# global vars are also defined here
26
+
25 27
 [ $# -lt 1 -o -n "${2//[0-3]/}" -o ${#2} -gt 1 ] && {
28
+	echo -e "\n  ddns-scripts Version: $VERSION"
26 29
 	echo -e "\n  USAGE:"
27
-	echo -e "  $0 [SECTION] [VERBOSE_MODE]\n"
30
+	echo    "  $0 [OPTION]"
31
+	echo    "  [OPTION]	  '-V' or '--version' display version and exit"
32
+	echo -e "\n  $0 [SECTION] [VERBOSE_MODE]\n"
28 33
 	echo    "  [SECTION]      - service section as defined in /etc/config/ddns"
29 34
 	echo    "  [VERBOSE_MODE] - '0' NO output to console"
30 35
 	echo    "                   '1' output to console"
@@ -36,7 +41,10 @@
36 41
 	exit 1
37 42
 }
38 43
 
39
-. /usr/lib/ddns/dynamic_dns_functions.sh	# global vars are also defined here
44
+[ "$1" = "-V" -o "$1" = "--version" ] && {
45
+	echo -e "ddns-scripts $VERSION\n"
46
+	exit 0
47
+}
40 48
 
41 49
 SECTION_ID="$1"
42 50
 VERBOSE_MODE=${2:-1}	# default mode is log to console
@@ -77,9 +85,12 @@ trap "trap_handler 15" 15	# SIGTERM	Termination
77 85
 # update_url	URL to use to update your "custom" DDNS service
78 86
 # update_script SCRIPT to use to update your "custom" DDNS service
79 87
 #
80
-# domain 	Your DNS name / replace [DOMAIN] in update_url
81
-# username 	Username of your DDNS service account / replace [USERNAME] in update_url
82
-# password 	Password of your DDNS service account / replace [PASSWORD] in update_url
88
+# lookup_host	FQDN of ONE of your at DDNS service defined host / required to validate if IP update happen/necessary
89
+# domain 	Nomally your DDNS hostname / replace [DOMAIN] in update_url
90
+# username 	Username of your DDNS service account / urlenceded and replace [USERNAME] in update_url
91
+# password 	Password of your DDNS service account / urlencoded and replace [PASSWORD] in update_url
92
+# param_enc	Optional parameter for (later) usage  / urlencoded and replace [PARAMENC] in update_url
93
+# param_opt	Optional parameter for (later) usage  / replace [PARAMOPT] in update_url
83 94
 #
84 95
 # use_https	use HTTPS to update DDNS service
85 96
 # cacert	file or directory where HTTPS can find certificates to verify server; 'IGNORE' ignore check of server certificate
@@ -140,14 +151,16 @@ ERR_LAST=$?	# save return code - equal 0 if SECTION_ID found
140 151
 	[ -f $LOGFILE ] && rm -f $LOGFILE		# clear logfile before first entry
141 152
 	write_log  7 "************ ************** ************** **************"
142 153
 	write_log  5 "PID '$$' started at $(eval $DATE_PROG)"
154
+	write_log  7 "ddns version  : $VERSION"
143 155
 	write_log  7 "uci configuration:\n$(uci -q show ddns | grep '=service' | sort)"
144 156
 	write_log 14 "Service section '$SECTION_ID' not defined"
145 157
 }
146 158
 
147 159
 write_log 7 "************ ************** ************** **************"
148 160
 write_log 5 "PID '$$' started at $(eval $DATE_PROG)"
161
+write_log 7 "ddns version  : $VERSION"
149 162
 write_log 7 "uci configuration:\n$(uci -q show ddns.$SECTION_ID | sort)"
150
-write_log 7 "ddns version  : $(opkg list-installed ddns-scripts | cut -d ' ' -f 3)"
163
+# write_log 7 "ddns version  : $(opkg list-installed ddns-scripts | cut -d ' ' -f 3)"
151 164
 case $VERBOSE_MODE in
152 165
 	0) write_log  7 "verbose mode  : 0 - run normal, NO console output";;
153 166
 	1) write_log  7 "verbose mode  : 1 - run normal, console mode";;
@@ -162,24 +175,41 @@ esac
162 175
 # determine what update url we're using if a service_name is supplied
163 176
 # otherwise update_url is set inside configuration (custom update url)
164 177
 # or update_script is set inside configuration (custom update script)
165
-[ -n "$service_name" ] && get_service_data update_url update_script
178
+[ -n "$service_name" ] && get_service_data update_url update_script SRV_ANSWER
166 179
 [ -z "$update_url" -a -z "$update_script" ] && write_log 14 "No update_url found/defined or no update_script found/defined!"
167 180
 [ -n "$update_script" -a ! -f "$update_script" ] && write_log 14 "Custom update_script not found!"
168 181
 
169
-# without domain and possibly username and password we can do nothing for you
170
-[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing 'domain'"
182
+# temporary needed to convert existing uci settings
183
+[ -z "$lookup_host" ] && {
184
+	uci -q set ddns.$SECTION_ID.lookup_host="$domain"
185
+	uci -q commit ddns
186
+	lookup_host="$domain"
187
+}
188
+# later versions only check if configured correctly
189
+
190
+# without lookup host and possibly other required options we can do nothing for you
191
+[ -z "$lookup_host" ] && write_log 14 "Service section not configured correctly! Missing 'lookup_host'"
192
+
171 193
 [ -n "$update_url" ] && {
172 194
 	# only check if update_url is given, update_scripts have to check themselves
195
+	[ -z "$domain" ] && $(echo "$update_url" | grep "\[DOMAIN\]" >/dev/null 2>&1) && \
196
+		write_log 14 "Service section not configured correctly! Missing 'domain'"
173 197
 	[ -z "$username" ] && $(echo "$update_url" | grep "\[USERNAME\]" >/dev/null 2>&1) && \
174 198
 		write_log 14 "Service section not configured correctly! Missing 'username'"
175 199
 	[ -z "$password" ] && $(echo "$update_url" | grep "\[PASSWORD\]" >/dev/null 2>&1) && \
176 200
 		write_log 14 "Service section not configured correctly! Missing 'password'"
201
+	[ -z "$param_enc" ] && $(echo "$update_url" | grep "\[PARAMENC\]" >/dev/null 2>&1) && \
202
+		write_log 14 "Service section not configured correctly! Missing 'param_enc'"
203
+	[ -z "$param_opt" ] && $(echo "$update_url" | grep "\[PARAMOPT\]" >/dev/null 2>&1) && \
204
+		write_log 14 "Service section not configured correctly! Missing 'param_opt'"
177 205
 }
178 206
 
179 207
 # url encode username (might be email or something like this)
180 208
 # and password (might have special chars for security reason)
209
+# and optional parameter "param_enc"
181 210
 [ -n "$username" ] && urlencode URL_USER "$username"
182 211
 [ -n "$password" ] && urlencode URL_PASS "$password"
212
+[ -n "$param_enc" ] && urlencode URL_PENC "$param_enc"
183 213
 
184 214
 # verify ip_source 'script' if script is configured and executable
185 215
 if [ "$ip_source" = "script" ]; then
@@ -289,7 +319,7 @@ while : ; do
289 319
 				&& write_log 6 "Update successful - IP '$LOCAL_IP' send" \
290 320
 				|| write_log 6 "Forced update successful - IP: '$LOCAL_IP' send"
291 321
 		else
292
-			write_log 3 "Can not update IP at DDNS Provider"
322
+			write_log 3 "IP update not accepted by DDNS Provider"
293 323
 		fi
294 324
 	fi
295 325
 

+ 18
- 11
net/ddns-scripts/files/services 查看文件

@@ -46,18 +46,18 @@
46 46
 "dnsexit.com"	"http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
47 47
 
48 48
 # OVH
49
-"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
49
+"ovh.com"	"http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
50 50
 
51 51
 # dns-o-matic is a free service by opendns.com for updating multiple hosts and
52 52
 # dynamic dns services in one api call. To update all your configured services
53 53
 # at once, use "all.dnsomatic.com as the hostname.
54
-"dnsomatic.com" "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
54
+"dnsomatic.com"	"http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
55 55
 
56 56
 # 3322.org
57
-"3322.org"  "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
57
+"3322.org"	"http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
58 58
 
59 59
 # namecheap.com
60
-"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
60
+"namecheap.com"	"http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
61 61
 
62 62
 # easydns.com dynamic DNS
63 63
 "easydns.com"	"http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
@@ -69,28 +69,35 @@
69 69
 "mythic-beasts.com"	"http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP"
70 70
 
71 71
 # Securepoint Dynamic-DNS-Service	(http://www.spdns.de)
72
-"spdns.de"	"http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
72
+"spdns.de"	"http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"	    "good|nochg"
73 73
 
74 74
 # duiadns.net - free dynamic DNS
75
-"duiadns.net"   "http://ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
75
+"duiadns.net"	"http://ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
76 76
 
77 77
 # Two-DNS - Simply. Connected. Everywhere.
78
-"twodns.de" "http://[USERNAME]:[PASSWORD]@update.twodns.de/update?hostname=[DOMAIN]&ip=[IP]"
78
+"twodns.de"	"http://[USERNAME]:[PASSWORD]@update.twodns.de/update?hostname=[DOMAIN]&ip=[IP]"
79 79
 
80 80
 # MyDNS.JP
81 81
 "mydns.jp"	"http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
82 82
 
83 83
 # LoopiaDNS
84
-"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
84
+"loopia.se"	"http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
85 85
 
86 86
 # SelfHost.de
87
-"selfhost.de"	"http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1"
87
+"selfhost.de"	"http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1"	    "good|nochg"
88 88
 
89 89
 # no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
90 90
 "no-ip.pl"	"http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
91 91
 
92 92
 # domains.google.com	non free service - require HTTPS communication
93
-"domains.google.com"	"https://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
93
+"domains.google.com"	"http://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
94 94
 
95 95
 # Schokokeks Hosting, schokokeks.org
96
-"schokokeks.org" "http://[USERNAME]:[PASSWORD]@dyndns.schokokeks.org/nic/update?myip=[IP]"
96
+"schokokeks.org"	"http://[USERNAME]:[PASSWORD]@dyndns.schokokeks.org/nic/update?myip=[IP]"
97
+
98
+# STRATO AG
99
+"strato.de"		"http://[USERNAME]:[PASSWORD]@dyndns.strato.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
100
+
101
+# Variomedia AG
102
+"variomedia.de" 	"http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
103
+

+ 5
- 1
net/ddns-scripts/files/services_ipv6 查看文件

@@ -25,7 +25,7 @@
25 25
 # 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
26 26
 
27 27
 # IPv6 @ Securepoint Dynamic-DNS-Service
28
-"spdns.de"	"http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
28
+"spdns.de"	"http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"	    "good|nochg"
29 29
 
30 30
 # IPv6 @ Hurricane Electric Dynamic DNS
31 31
 "he.net"	"http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
@@ -41,3 +41,7 @@
41 41
 
42 42
 # IPv6 @ LoopiaDNS
43 43
 "loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
44
+
45
+# Variomedia AG
46
+"variomedia.de" 	"http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
47
+

+ 981
- 36
net/ddns-scripts/files/tld_names.dat
文件差異過大導致無法顯示
查看文件


+ 18
- 3
net/ddns-scripts/samples/ddns.config_sample 查看文件

@@ -115,9 +115,13 @@ config service "myddns"
115 115
 #	option update_script   ""
116 116
 
117 117
 	###########
118
-	# You must specify your domain/host name, your username and your password
119
-	# as you get from you DDNS provider. Keep an eye on providers help pages.
118
+	# Keep an eye on providers help pages.
120 119
 	#
120
+	# FQDN of ONE of your defined host at DDNS provider
121
+	# REQUIRED to verify what the current IP at DNS using nslookup/host command
122
+	# default: none
123
+	option lookup_host ""
124
+
121 125
 	# Your DNS name / replace [DOMAIN] in update_url
122 126
 	# default: none
123 127
 	option domain ""
@@ -126,10 +130,21 @@ config service "myddns"
126 130
 	# default: none
127 131
 	option username ""
128 132
 
129
-	# Password of your DDNS service account / replace [PASSWORD] in update_url
133
+	# Password of your DDNS service account / replace [PASSWORD] in update url
130 134
 	# default: none
131 135
 	option password ""
132 136
 
137
+	###########
138
+	# Optional parameters for use inside update_url
139
+	#
140
+	# parameter that will be urlencoded before replacement of [PARAMENC] inside update url
141
+	# default: none
142
+	option param_enc ""
143
+
144
+	# parameter that repace [PARAMOPT] inside update url
145
+	# default: none
146
+	option param_opt ""
147
+
133 148
 	###########
134 149
 	# use HTTPS for secure communication with you DDNS provider
135 150
 	# personally found some providers having problems when not sending

+ 6
- 4
net/ddns-scripts/samples/update_sample.sh 查看文件

@@ -18,13 +18,15 @@
18 18
 #
19 19
 # tested with spdns.de
20 20
 local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
21
-# inside url we need username and password
21
+# inside url we need domain, username and password
22
+[ -z "$domain" ]   && write_log 14 "Service section not configured correctly! Missing 'domain'"
22 23
 [ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'"
23 24
 [ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'"
24 25
 
25 26
 # do replaces in URL
26
-__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
27
-			       -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
27
+__URL=$(echo $__URL |  | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
28
+			     -e "s#\[PARAMENC\]#$URL_PENC#g" -e "s#\[PARAMOPT\]#$param_opt#g" \
29
+			     -e "s#\[DOMAIN\]#$domain#g"     -e "s#\[IP\]#$__IP#g")
28 30
 [ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
29 31
 
30 32
 do_transfer "$__URL" || return 1
@@ -34,6 +36,6 @@ write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
34 36
 # analyse provider answers
35 37
 # "good [IP_ADR]"	= successful
36 38
 # "nochg [IP_ADR]"	= no change but OK
37
-grep -E "good|nochg" $DATFILE >/dev/null 2>&1
39
+grep -i -E "good|nochg" $DATFILE >/dev/null 2>&1
38 40
 return $?	# "0" if "good" or "nochg" found
39 41