sysupgrade: fixes broken pipe error during sysupgade

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36548
This commit is contained in:
John Crispin 2013-05-05 12:41:42 +00:00
parent 6b4f3344df
commit c7c243669c
1 changed files with 2 additions and 2 deletions

View File

@ -157,14 +157,14 @@ get_image() { # <source> [ <command> ]
*) cmd="cat";;
esac
if [ -z "$conc" ]; then
local magic="$(eval $cmd $from | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
local magic="$(eval $cmd $from 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
case "$magic" in
1f8b) conc="zcat";;
425a) conc="bzcat";;
esac
fi
eval "$cmd $from ${conc:+| $conc}"
eval "$cmd $from 2>/dev/null ${conc:+| $conc}"
}
get_magic_word() {