From b16cedb0a079d05de8283ede748ffd8193bb2051 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 15 Mar 2009 12:33:26 +0000 Subject: [PATCH] Fix endianess in shell_get (#4294) git-svn-id: svn://svn.openwrt.org/openwrt/packages@14883 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/ddns-scripts/Makefile | 2 +- net/ddns-scripts/files/usr/lib/ddns/shell_get.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index f8e694683..539887b86 100644 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh b/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh index 876261762..ec9fc0cde 100755 --- a/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/shell_get.sh @@ -33,7 +33,7 @@ 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 }' ) + hex_str=$( echo -n "$original_str" | hexdump -v -e '1/1 "%02x"' | 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 ))