mirror of
https://github.com/openwrt/packages.git
synced 2026-01-09 19:31:21 +00:00
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>
This commit is contained in:
@@ -115,9 +115,13 @@ config service "myddns"
|
||||
# option update_script ""
|
||||
|
||||
###########
|
||||
# You must specify your domain/host name, your username and your password
|
||||
# as you get from you DDNS provider. Keep an eye on providers help pages.
|
||||
# Keep an eye on providers help pages.
|
||||
#
|
||||
# FQDN of ONE of your defined host at DDNS provider
|
||||
# REQUIRED to verify what the current IP at DNS using nslookup/host command
|
||||
# default: none
|
||||
option lookup_host ""
|
||||
|
||||
# Your DNS name / replace [DOMAIN] in update_url
|
||||
# default: none
|
||||
option domain ""
|
||||
@@ -126,10 +130,21 @@ config service "myddns"
|
||||
# default: none
|
||||
option username ""
|
||||
|
||||
# Password of your DDNS service account / replace [PASSWORD] in update_url
|
||||
# Password of your DDNS service account / replace [PASSWORD] in update url
|
||||
# default: none
|
||||
option password ""
|
||||
|
||||
###########
|
||||
# Optional parameters for use inside update_url
|
||||
#
|
||||
# parameter that will be urlencoded before replacement of [PARAMENC] inside update url
|
||||
# default: none
|
||||
option param_enc ""
|
||||
|
||||
# parameter that repace [PARAMOPT] inside update url
|
||||
# default: none
|
||||
option param_opt ""
|
||||
|
||||
###########
|
||||
# use HTTPS for secure communication with you DDNS provider
|
||||
# personally found some providers having problems when not sending
|
||||
|
||||
@@ -18,13 +18,15 @@
|
||||
#
|
||||
# tested with spdns.de
|
||||
local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
# inside url we need username and password
|
||||
# inside url we need domain, username and password
|
||||
[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing 'domain'"
|
||||
[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'"
|
||||
[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'"
|
||||
|
||||
# do replaces in URL
|
||||
__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
|
||||
-e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
|
||||
__URL=$(echo $__URL | | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
|
||||
-e "s#\[PARAMENC\]#$URL_PENC#g" -e "s#\[PARAMOPT\]#$param_opt#g" \
|
||||
-e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
|
||||
[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
|
||||
|
||||
do_transfer "$__URL" || return 1
|
||||
@@ -34,6 +36,6 @@ write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
|
||||
# analyse provider answers
|
||||
# "good [IP_ADR]" = successful
|
||||
# "nochg [IP_ADR]" = no change but OK
|
||||
grep -E "good|nochg" $DATFILE >/dev/null 2>&1
|
||||
grep -i -E "good|nochg" $DATFILE >/dev/null 2>&1
|
||||
return $? # "0" if "good" or "nochg" found
|
||||
|
||||
|
||||
Reference in New Issue
Block a user