From 361c6853067b3c0d94d3b9024d9a663f0a59c98c Mon Sep 17 00:00:00 2001 From: xor Date: Sun, 4 Oct 2015 18:53:51 +0200 Subject: [PATCH] comments .\o/ --- hashboot | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hashboot b/hashboot index 4aee37e..748bfb4 100755 --- a/hashboot +++ b/hashboot @@ -107,17 +107,22 @@ then #Exists ${DIGEST_FILE}, if true run du magic, else write ${DIGEST_FILE} if [ -f ${DIGEST_FILE} ] then + + #Collect mbr and /boot hashes and write to $DIGEST_FILE_TMP write_hashes $DIGEST_FILE_TMP - + + #Compare $DIGEST_FILE_TMP against ${DIGEST_FILE} and exit, when fine. Otherwise do magic. if diff -q --ignore-matching-lines='^#' ${DIGEST_FILE} ${DIGEST_FILE_TMP} ; then echo "alles fine und die exit definieren" die 0 else + #Compare actual hashes of MBR against saved hashes. if [ "$(grep ${MBR_TMP} ${DIGEST_FILE})" != "$(grep ${MBR_TMP} ${DIGEST_FILE_TMP})" ] then echo "at least mbr must be written." fi + #Compare actual hashes of /boot against saved hashes. if [ "$(grep -v ${MBR_TMP} ${DIGEST_FILE})" != "$(grep -v ${MBR_TMP} ${DIGEST_FILE_TMP})" ] then echo "anything here, must be rewritten."