backuptool: Use cut instead of awk
recovery has removed busybox in favor of toybox, and toybox does not
currently implement awk.
Change-Id: I9d91f52020e8a7b5b02dce27f3d82e6bf0aa1811
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh
index 80e4e20..7ff0c88 100755
--- a/prebuilt/common/bin/backuptool.sh
+++ b/prebuilt/common/bin/backuptool.sh
@@ -45,7 +45,7 @@
## Discard any known bad backup scripts
cd /$1/addon.d/
for f in *sh; do
- s=$(md5sum $f | awk {'print $1'})
+ s=$(md5sum $f | cut -c-32)
grep -q $s /system/addon.d/blacklist && rm -f $f
done
fi
@@ -57,7 +57,7 @@
## forcefully keep any version-independent stuff
cd /$1/addon.d/
for f in *sh; do
- s=$(md5sum $f | awk {'print $1'})
+ s=$(md5sum $f | cut -c-32)
grep -q $s /system/addon.d/whitelist
if [ $? -eq 0 ]; then
found=1