Fix endianess in shell_get (#4294)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@14883 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2009-03-15 12:33:26 +00:00
parent 28769a3d24
commit b16cedb0a0
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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 ))