# Permits multiple runs
MOUNTP="$(mktemp -d -p ${SAFE_TMPDIR} live-snapshot-mnt.XXXXXX)"
+DEST="${MOUNTP}/live-sn.cpio.gz"
+
+# Command line defaults and declarations
SNAP_COW="/live/cow"
SNAP_DEV=""
-DEST="${MOUNTP}/live-sn.cpio.gz"
-SNAP_TYPE="cpio"
-DESKTOP_LINK="/home/${USERNAME}/Desktop/live-snapshot"
+SNAP_OUTPUT=""
SNAP_RESYNC_STRING=""
+SNAP_TYPE="cpio"
Error ()
{
Error "unrecognized resync string"
;;
esac
- else
+ elif [ -z "${SNAP_OUTPUT}" ]
+ then
# Set target file based on image
case "${SNAP_TYPE}" in
cpio)
DEST="${MOUNTP}/live-sn.ext2"
;;
esac
+ else
+ DEST="${SNAP_OUTPUT}"
fi
}
Clean ()
{
- if echo "${DEST}" | grep -q "${MOUNTP}"
+ if [ -z "${SNAP_RESYNC_STRING}" ] && echo "${DEST}" | grep -q "${MOUNTP}"
then
echo "${DEST} is present on ${MOUNTP}, therefore no automatic unmounting the latter." > /dev/null 1>&2
else