clean up md5s() shell function
authorFelix Fietkau <nbd@openwrt.org>
Tue, 2 Sep 2008 10:57:51 +0000 (10:57 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 2 Sep 2008 10:57:51 +0000 (10:57 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12493 3c298f89-4303-0410-b956-a3cf2f4a3e73

include/shell.sh

index f6be6c5..634beed 100644 (file)
@@ -30,5 +30,8 @@ trapret() {(
 )}
 
 md5s() {
-       which md5sum 2>&1 >/dev/null && md5sum "$@" | awk '{print $1}' || md5 "$@"
+       cat "$@" | (
+               md5sum 2>/dev/null ||
+               md5 
+       ) | awk '{print $1}'
 }