reverting my mistake

pull/1/head
xor 2015-10-04 20:24:20 +02:00
parent ec48450ac3
commit 1ab5755792
1 changed files with 4 additions and 4 deletions

View File

@ -93,12 +93,12 @@ else
fi fi
# Find out where the first partition starts and set ${MBR_SIZE} in KiB # 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 if [ "${sectorsize}" == "=" ] # Older versions of util-linux
then 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 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) MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024)
@ -164,7 +164,7 @@ then
fi fi
elif [ "${1}" == "check" ] elif [ "${1}" == "check" ]
then 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 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}) if ! $(grep ${MBR_TMP} ${DIGEST_FILE} | ${HASHER} --check --warn --quiet --strict > ${LOG_FILE})