mirror of
https://schlomp.space/tastytea/hashboot
synced 2024-11-16 14:37:06 +01:00
comments .\o/
This commit is contained in:
parent
9943977cd0
commit
361c685306
5
hashboot
5
hashboot
@ -107,17 +107,22 @@ then
|
|||||||
#Exists ${DIGEST_FILE}, if true run du magic, else write ${DIGEST_FILE}
|
#Exists ${DIGEST_FILE}, if true run du magic, else write ${DIGEST_FILE}
|
||||||
if [ -f ${DIGEST_FILE} ]
|
if [ -f ${DIGEST_FILE} ]
|
||||||
then
|
then
|
||||||
|
|
||||||
|
#Collect mbr and /boot hashes and write to $DIGEST_FILE_TMP
|
||||||
write_hashes $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} ;
|
if diff -q --ignore-matching-lines='^#' ${DIGEST_FILE} ${DIGEST_FILE_TMP} ;
|
||||||
then
|
then
|
||||||
echo "alles fine und die exit definieren"
|
echo "alles fine und die exit definieren"
|
||||||
die 0
|
die 0
|
||||||
else
|
else
|
||||||
|
#Compare actual hashes of MBR against saved hashes.
|
||||||
if [ "$(grep ${MBR_TMP} ${DIGEST_FILE})" != "$(grep ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
if [ "$(grep ${MBR_TMP} ${DIGEST_FILE})" != "$(grep ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
||||||
then
|
then
|
||||||
echo "at least mbr must be written."
|
echo "at least mbr must be written."
|
||||||
fi
|
fi
|
||||||
|
#Compare actual hashes of /boot against saved hashes.
|
||||||
if [ "$(grep -v ${MBR_TMP} ${DIGEST_FILE})" != "$(grep -v ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
if [ "$(grep -v ${MBR_TMP} ${DIGEST_FILE})" != "$(grep -v ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
||||||
then
|
then
|
||||||
echo "anything here, must be rewritten."
|
echo "anything here, must be rewritten."
|
||||||
|
Loading…
Reference in New Issue
Block a user