#!/bin/sh

Die() {
    echo "$1"
    exit 1
}

# ------------------------------ main -----------------------------------

echo "MONDO-COMPARE"
echo ""

if [ -e "/mnt/cdrom/archives/NO-TARBALLS-HERE" ] ; then
    echo "This is Mondo Rescue CD has no tarballs."
    echo "Mondo-restore is exiting."
    exit 0
fi

ide-opt-on

echo " " > /tmp/MOUNT-READONLY
# check-mountlist-sanity /tmp/mountlist.txt
mount-me || Die "(mondo-compare) Unable to mount partitions."
compare-me || echo "Warning - compare-me returned error(s)."
echo "Someday, HR will teach me how to compare boot sectors and MBRs."
unmount-me || Die "(mondo-compare) Unable to unmount partitions."
echo ""
echo "If you want to do clever stuff, re-insert the Mondo CD."
rm /tmp/MOUNT-READONLY -f
eject /dev/cdrom
exit 0
