X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=bin%2Flive-snapshot;h=03245ea6e251f699afd0a35c3b8a32b54fa88420;hb=b7e456cbafb2d594a9f9317f11a99740bd1af4d6;hp=dc1fa6d70ae8debe1e81147108ecb4997aeccc4b;hpb=5ce5bb4dda84fa6796838bed3a78a03a8b1b33bf;p=live-boot-grml.git diff --git a/bin/live-snapshot b/bin/live-snapshot index dc1fa6d..03245ea 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 @@ -206,7 +194,7 @@ Defaults () then SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | cut -f1 -d ':') SNAP_DEV=$(echo "${SNAP_RESYNC_STRING}" | cut -f2 -d ':') - DEST=$(echo "${SNAP_RESYNC_STRING}" | cut -f3 -d ':') + DEST="${MOUNTP}/$(echo ${SNAP_RESYNC_STRING} | cut -f3 -d ':')" case "${DEST}" in *.cpio.gz) @@ -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