From c69f57affe066b480c985df526985f3d05c03908 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 22 Jan 2018 02:34:58 +0000 Subject: [PATCH] Tighten up grep matches --- pishrink.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pishrink.sh b/pishrink.sh index 188ce73..6cf98f0 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -53,8 +53,8 @@ partnum=$(echo "$parted_output" | cut -d ':' -f 1) partstart=$(echo "$parted_output" | cut -d ':' -f 2 | tr -d 'B') loopback=$(losetup -f --show -o $partstart "$img") tune2fs_output=$(tune2fs -l $loopback) -currentsize=$(echo "$tune2fs_output" | grep 'Block count' | tr -d ' ' | cut -d ':' -f 2) -blocksize=$(echo "$tune2fs_output" | grep 'Block size' | tr -d ' ' | cut -d ':' -f 2) +currentsize=$(echo "$tune2fs_output" | grep '^Block count:' | tr -d ' ' | cut -d ':' -f 2) +blocksize=$(echo "$tune2fs_output" | grep '^Block size:' | tr -d ' ' | cut -d ':' -f 2) #Check if we should make pi expand rootfs on next boot if [ "$should_skip_autoexpand" = false ]; then