merge r15423 and r16161 to 8.09 [ddns-scripts] Remove erroneous http:// in zonedit...
authorAndy Boyett <agb@openwrt.org>
Sun, 31 May 2009 07:56:29 +0000 (07:56 +0000)
committerAndy Boyett <agb@openwrt.org>
Sun, 31 May 2009 07:56:29 +0000 (07:56 +0000)
SVN-Revision: 16225

net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh
net/ddns-scripts/files/usr/lib/ddns/services
net/ddns-scripts/files/usr/lib/ddns/shell_get.sh [deleted file]

index f8e694683d497afdbddb0d56e7e1d71de4840fe4..c7fc6d9fff7c6cffa428fa1436efd638914b059b 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=1.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=1.1
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index fde13b7dbc71faabebb47bbab9e96236c0824b29..62d4886971bd78154ca8bc97a01d18798e4096de 100755 (executable)
@@ -9,11 +9,6 @@
 #
 
 . /usr/lib/ddns/dynamic_dns_functions.sh
-. /usr/lib/ddns/shell_get.sh
-
-
-
-
 
 
 service_id=$1
@@ -90,17 +85,7 @@ fi
 
 #some constants
 
-retrieve_prog="/usr/bin/wget --no-check-certificate -O - ";
-if [ -h "/usr/bin/wget" ]
-then
-       busybox_wget=$(ls -l /usr/bin/wget | awk ' { if ($0~/busybox/) { print "BUSYBOX"}} ')
-       if [ -n "$busybox_wget" ]; then
-               retrieve_prog="shell_get"
-       fi
-fi
-
-verbose_echo "retrieve_prog=\"$retrieve_prog\""
-
+retrieve_prog="/usr/bin/wget -O - ";
 service_file="/usr/lib/ddns/services"
 
 ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
index 3c14c3cadb89b843c5313adc92f6fedf1a86d703..7fafba15781ec64bfcb5f922df0e48b8e858aa44 100644 (file)
@@ -10,7 +10,7 @@
 
 "dyndns.org"           "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "changeip.com"         "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]"
-"zoneedit.com"         "http://[USERNAME]:[PASSWORD]@http://dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
+"zoneedit.com"         "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
 
 #noip is an alias of no-ip, so allow both names for the same service
 "no-ip.com"            "http://dynupdate.no-ip.com/ducupdate.php?username=[USERNAME]&pass=[PASSWORD]&h[]=[DOMAIN]&ip=[IP]"     
diff --git a/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh b/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh
deleted file mode 100755 (executable)
index 8762617..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#######################################################################
-#/usr/lib/ddns/shell_get.sh
-#
-# Written by Eric Bishop, January 2008
-# Distributed under the terms of the GNU General Public License (GPL) version 2.0
-#
-# This implements a wget-like program ("shell_get 1.0") that can handle 
-# basic http username/password authentication.
-# It is implemented using the netcat (nc) utility. 
-# This is necessary because the default busybox wget
-# does not include username/password functionality (it really sucks)
-##########################################################################
-
-to_ascii()
-{
-       dec=$1
-       hex=""
-       if [ $dec -lt 26 ]; then
-               hex=$(($dec + 0x41))
-       elif [ $dec -ge 26 ] && [ $dec -lt 52 ]; then
-               hex=$(( ($dec-26) + 0x61))
-       elif [ $dec -ge 52 ] && [ $dec -lt 62 ]; then
-               hex=$(( ($dec-52) + 0x30))
-       elif [ $dec -eq 62 ]; then
-               hex=43
-       else
-               hex=47
-       fi
-       printf "%x" $hex
-}
-
-encode_base64()
-{
-       original_str=$1
-       
-       hex_str=$( echo -n "$original_str" | hexdump -v | awk '{ for ( i = 2; i <= NF; i++ ) {  h1=substr($i, 3, 2); h2=substr($i,0,2); printf("%s%s", h1, h2); }}' | awk ' { $0~gsub(/00$/, "") };{ i=1; while(i <= length($0) ){ block= substr($0, i, 3); printf("%s ", block); i=i+3;  }}' | awk ' {$0~gsub(/ $/, "")}; { print $0 }' )
-
-       length=$(echo $hex_str | awk  '{$0~gsub(/ /, "")}; { print length($0) }')
-       remainder=$(($length % 3 ))
-       if [ $remainder -eq 1 ]; then
-               hex_str=$hex_str'00'
-       elif [ $remainder -eq 2 ]; then
-               hex_str=$hex_str'0'
-       fi
-
-
-
-
-       base_64_str=""
-       for hex_block in $hex_str
-       do
-               char1=$(to_ascii $((0x$hex_block / 64)))
-               char2=$(to_ascii $((0x$hex_block % 64)))
-               base_64_str=$(printf "$base_64_str\x$char1\x$char2")
-       done
-       
-       
-       if [ $remainder -eq 1 ]; then
-               base_64_str=$(echo "$base_64_str" | awk '{ $0~gsub(/A$/, "=");} { print $0 }' )
-       elif [ $remainder -eq 2 ]; then
-               base_64_str=$(echo "$base_64_str==")
-       fi
-       
-
-       echo $base_64_str
-}
-
-shell_get()
-{
-       full_url=$1
-
-       protocol_str=$(echo $full_url | awk ' BEGIN {FS="://"} { if($0~/:\/\//)print $1 }')
-       if [ "$protocol_str" != "http" ] && [ -n "$protocol_str" ] ; then
-               echo "protocol = $protocol_str"
-               echo "Error, unsupported Protocol"
-               echo "Only http connections are supported at this time"
-               return 1;
-       fi
-
-
-       if [ -n "$protocol_str" ] ; then
-               full_url=$(echo $full_url | awk ' {$0~gsub(/http:\/\//, "")}; {print $0}')
-       fi
-
-
-
-       user_pass=$(echo $full_url | awk ' BEGIN {FS="@"}; { if( $0~/@/ && $1~/^[^\?\/]+:[^\?\/]+$/ ) print $1 }')
-       host_and_args=""
-       if [ -n "$user_pass" ]; then
-               host_and_args=$(echo $full_url | awk ' $0~gsub(/^[^@]+@/, "") {print $0}')
-       else
-               host_and_args="$full_url"
-       fi
-
-       host_name=$(echo $host_and_args | awk ' BEGIN {FS="[:?/]"}; {print $1};')
-       port_num=$(echo $host_and_args | awk ' BEGIN {FS="[?/]"}; { if($1~/:/){$1~gsub(/.*:/, ""); print $1;}else {print "80"}};')
-
-       path=$(echo $host_and_args | awk ' { $0~gsub(/^[^\?\/]+/, "")}; {print $0};')
-       path_start_test=$(echo "$path" | grep "^/") 
-       if [ -z "$path_start_test" ]; then
-               path="/$path"
-       fi
-
-
-       #echo "full_url=\"$full_url\""
-       #echo "user_pass=\"$user_pass\""
-       #echo "host_name=\"$host_name\""
-       #echo "port_num=\"$port_num\""
-       #echo "path=\"$path\""
-
-
-       retrieved_data=""
-       if [ -n "$user_pass" ]; then
-               auth_str=$(encode_base64 "$user_pass" )
-               #echo -e "GET $path HTTP/1.0\nHost: $host_name\nAuthorization: Basic $auth_str\nUser-Agent: shell_get 1.0\n\n"
-               retrieved_data=$(echo -e "GET $path HTTP/1.0\nHost: $host_name\nAuthorization: Basic $auth_str\nUser-Agent: shell_get 1.0\n\n" | nc "$host_name" $port_num | cat)
-
-       else
-               #echo -e "GET $path HTTP/1.0\nHost: $host_name\nUser-Agent: shell_get 1.0\n\n"
-               retrieved_data=$(echo -e "GET $path HTTP/1.0\nHost: $host_name\nUser-Agent: shell_get 1.0\n\n" | nc "$host_name" $port_num | cat)
-       fi
-
-       echo -e "$retrieved_data"
-
-}
-