From 1ab5755792ab2ce5236152d482b08c460271f139 Mon Sep 17 00:00:00 2001 From: xor Date: Sun, 4 Oct 2015 20:24:20 +0200 Subject: [PATCH] reverting my mistake --- hashboot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hashboot b/hashboot index 130e8f9..ea009e1 100755 --- a/hashboot +++ b/hashboot @@ -93,12 +93,12 @@ else fi # Find out where the first partition starts and set ${MBR_SIZE} in KiB -sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' ) +sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' | awk '{print $8}' ) if [ "${sectorsize}" == "=" ] # Older versions of util-linux then - sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' ) + sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' | awk '{print $9}' ) fi -startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 ) +startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}' ) MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024) @@ -164,7 +164,7 @@ then fi elif [ "${1}" == "check" ] then - HASHER=$(head -n1 ${DIGEST_FILE} ) + HASHER=$(head -n1 ${DIGEST_FILE} | awk '{print $5}') dd if=${MBR_DEVICE} of=${MBR_TMP} bs=${MBR_SIZE}K count=1 status=noxfer || die 8 if ! $(grep ${MBR_TMP} ${DIGEST_FILE} | ${HASHER} --check --warn --quiet --strict > ${LOG_FILE})