backuptool: Use cut instead of awk

recovery has removed busybox in favor of toybox, and toybox does not
currently implement awk.

Change-Id: I9d91f52020e8a7b5b02dce27f3d82e6bf0aa1811
This commit is contained in:
Tom Marshall 2015-11-18 14:45:04 -08:00 committed by Steve Kondik
parent ffcd990922
commit 517e6915cc

View File

@ -45,7 +45,7 @@ check_blacklist() {
## Discard any known bad backup scripts ## Discard any known bad backup scripts
cd /$1/addon.d/ cd /$1/addon.d/
for f in *sh; do 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 grep -q $s /system/addon.d/blacklist && rm -f $f
done done
fi fi
@ -57,7 +57,7 @@ check_whitelist() {
## forcefully keep any version-independent stuff ## forcefully keep any version-independent stuff
cd /$1/addon.d/ cd /$1/addon.d/
for f in *sh; do for f in *sh; do
s=$(md5sum $f | awk {'print $1'}) s=$(md5sum $f | cut -c-32)
grep -q $s /system/addon.d/whitelist grep -q $s /system/addon.d/whitelist
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
found=1 found=1