X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=bin%2Flive-snapshot;h=5837f5d1dd783915fd053251f46225f3773a6414;hb=9f0888fd9ffcbb319722a39e9f357693800f2b6b;hp=b523c4adcd344abe9dba348584dec0599183ed33;hpb=e0c2f1d0cef706c3a87aa3fb6d17c01e117c66ad;p=live-boot-grml.git diff --git a/bin/live-snapshot b/bin/live-snapshot index b523c4a..5837f5d 100755 --- a/bin/live-snapshot +++ b/bin/live-snapshot @@ -42,6 +42,7 @@ SAFE_TMPDIR="/live" 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" @@ -125,19 +126,6 @@ Version () 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 @@ -228,7 +216,8 @@ Defaults () Error "unrecognized resync string" ;; esac - else + elif [ -z "${SNAP_OUTPUT}" ] + then # Set target file based on image case "${SNAP_TYPE}" in cpio) @@ -243,6 +232,8 @@ Defaults () DEST="${MOUNTP}/live-sn.ext2" ;; esac + else + DEST="${SNAP_OUTPUT}" fi } @@ -270,8 +261,6 @@ Validate_input () Mount_device () { - mkdir -p "${MOUNTP}" - case "${SNAP_DEV}" in "") # create a temp @@ -318,7 +307,7 @@ Do_snapshot () 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