mirror of https://schlomp.space/tastytea/hashboot
Small tuning on near feature.
parent
4d9a996b47
commit
d0deec57dc
33
hashboot
33
hashboot
|
@ -106,27 +106,28 @@ then
|
||||||
[ -z "${HASHER}" ] && die 5 "No hash calculator found"
|
[ -z "${HASHER}" ] && die 5 "No hash calculator found"
|
||||||
|
|
||||||
read_config
|
read_config
|
||||||
|
if [ -f ${DIGEST_FILE} ]
|
||||||
|
write_hashes $DIGEST_FILE_TMP
|
||||||
|
|
||||||
write_hashes $DIGEST_FILE_TMP
|
if diff -q --ignore-matching-lines='^#' ${DIGEST_FILE} ${DIGEST_FILE_TMP} ;
|
||||||
|
|
||||||
if diff -q --ignore-matching-lines='^#' ${DIGEST_FILE} ${DIGEST_FILE_TMP} ;
|
|
||||||
then
|
|
||||||
echo "alles fine und die exit definieren"
|
|
||||||
die 0
|
|
||||||
else
|
|
||||||
if [ "$(grep ${MBR_TMP} ${DIGEST_FILE})" != "$(grep ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
|
||||||
then
|
then
|
||||||
echo "at least mbr must be written."
|
echo "alles fine und die exit definieren"
|
||||||
fi
|
die 0
|
||||||
if [ "$(grep -v ${MBR_TMP} ${DIGEST_FILE})" != "$(grep -v ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
else
|
||||||
then
|
if [ "$(grep ${MBR_TMP} ${DIGEST_FILE})" != "$(grep ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
||||||
echo "anything here, must be rewritten."
|
then
|
||||||
cp ${DIGEST_FILE_TMP} ${DIGEST_FILE} || die 7
|
echo "at least mbr must be written."
|
||||||
rm ${DIGEST_FILE_TMP}
|
fi
|
||||||
|
if [ "$(grep -v ${MBR_TMP} ${DIGEST_FILE})" != "$(grep -v ${MBR_TMP} ${DIGEST_FILE_TMP})" ]
|
||||||
|
then
|
||||||
|
echo "anything here, must be rewritten."
|
||||||
|
fi
|
||||||
|
mv ${DIGEST_FILE_TMP} ${DIGEST_FILE} || die 7
|
||||||
echo "List of hashes written to ${DIGEST_FILE}"
|
echo "List of hashes written to ${DIGEST_FILE}"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
write_hashes $DIGEST_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Backup of good files
|
#Backup of good files
|
||||||
tar -czpPf ${BACKUP_FILE} ${MBR_TMP} /boot ${DIGEST_FILE}
|
tar -czpPf ${BACKUP_FILE} ${MBR_TMP} /boot ${DIGEST_FILE}
|
||||||
if [ $? == 0 ]
|
if [ $? == 0 ]
|
||||||
|
|
Loading…
Reference in New Issue