mirror of
https://github.com/novatiq/packages.git
synced 2026-07-30 23:33:06 +01:00
ddns-scripts: Update to Version 2.1.0-1 see description
- fixed postinst and prerm in Makefile - implementation of provider specific update scripts into services and services_ipv6 file. first Provider "no-ip.com" - Thanks to DarkStarXxX for request and testing - finished uci/ddns wiki at http://wiki.openwrt.org/doc/uci/ddns - rewritten retry management - rewritten logging including following Issue 469 https://github.com/openwrt/packages/issues/469 - stop running sections on hotplug ifdown event (like start on ifup) - implement trap detection also kill "sleep" child processes SIGHUP to reload configuration (not really reloading, simply starting a new process) /etc/init.d/ddns reload implemented - code optimization - new provider LoopiaDNS.se Issue 494 https://github.com/openwrt/packages/issues/494 Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
@@ -16,22 +16,22 @@
|
||||
#
|
||||
# the code here is the copy of the default used inside send_update()
|
||||
#
|
||||
local __USER __PASS __ANSWER
|
||||
local __ANSWER
|
||||
# tested with spdns.de
|
||||
local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
|
||||
|
||||
# do replaces in URL
|
||||
__urlencode __USER "$username" # encode username, might be email or something like this
|
||||
__urlencode __PASS "$password" # encode password, might have special chars for security reason
|
||||
__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$__USER#g" -e "s#\[PASSWORD\]#$__PASS#g" \
|
||||
__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")
|
||||
[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
|
||||
|
||||
__do_transfer __ANSWER "$__URL"
|
||||
__ERR=$?
|
||||
[ $__ERR -gt 0 ] && {
|
||||
verbose_echo "\n!!!!!!!!! ERROR =: Error sending update to DDNS Provider\n"
|
||||
return 1
|
||||
}
|
||||
verbose_echo " update send =: DDNS Provider answered\n$__ANSWER"
|
||||
return 0
|
||||
do_transfer __ANSWER "$__URL" || return 1
|
||||
|
||||
write_log 7 "DDNS Provider answered:\n$__ANSWER"
|
||||
|
||||
# analyse provider answers
|
||||
# "good [IP_ADR]" = successful
|
||||
# "nochg [IP_ADR]" = no change but OK
|
||||
echo "$__ANSWER" | grep -E "good|nochg" >/dev/null 2>&1
|
||||
return $? # "0" if "good" or "nochg" found
|
||||
|
||||
|
||||
Reference in New Issue
Block a user