MOUNTP="$(mktemp -d -p ${SAFE_TMPDIR} live-snapshot-mnt.XXXXXX)"
SNAP_COW="/live/cow"
SNAP_DEV=""
+SNAP_OUTPUT=""
DEST="${MOUNTP}/live-sn.cpio.gz"
SNAP_TYPE="cpio"
DESKTOP_LINK="/home/${USERNAME}/Desktop/live-snapshot"
exit 0
}
-Is_same_mount ()
-{
- dir1="$(Base_path ${1})"
- dir2="$(Base_path ${2})"
-
- if [ "${dir1}" = "${dir2}" ]
- then
- return 0
- else
- return 1
- fi
-}
-
Parse_args ()
{
# Parse command line
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
}
Mount_device ()
{
- mkdir -p "${MOUNTP}"
-
case "${SNAP_DEV}" in
"")
# create a temp
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