# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
-# Some defaults:
-MOUNTP="/mnt/casper-snapshot"
-COW="/cow"
+MOUNTP=""
+COW=""
DEV=""
-DEST="${MOUNTP}/casper-sn.cpio.gz"
-TYPE="cpio"
-DESKTOP_LINK=/home/$USERNAME/Desktop/casper-snapshot
+DEST=""
+TYPE=""
+DESKTOP_LINK=""
Header ()
{
echo " -d, --device: specifies the output snapshot device (default: none)."
echo " -o, --output: specifies the output image file (default: $type dependent)."
echo " -r, --resync-string: internally used to resync previous made snapshots."
- echo " -t,--type: specifies the snapshot type between \'squashfs\', \'ext2\' or \'cpio\'.gz archive (default: cpio)"
+ echo " -t, --type: specifies the snapshot type between \"squashfs\", \"ext2\" or \"cpio\".gz archive (default: cpio)"
echo -e "\nLook at casper-snapshot(1) man page for more information."
exit 0
}
mkdir -p "${MOUNTP}"
fi
- if [ -n "${dev}" ]; then
+ if [ -z "${dev}" ]; then
# create a temp
mount -t tmpfs -o rw tmpfs "${MOUNTP}"
if [ ! -L /home/$USERNAME/Desktop/casper-snapshot ]; then
Defaults ()
{
+ MOUNTP="/mnt/casper-snapshot"
+ COW="/cow"
+ DEV=""
+ DEST="${MOUNTP}/casper-sn.cpio.gz"
+ TYPE="cpio"
+ DESKTOP_LINK=/home/$USERNAME/Desktop/casper-snapshot
+
if [ -n "${SNAP_RSTRING}" ]; then
COW=$(echo "${SNAP_RSTRING}" | cut -f1 -d ':')
DEV=$(echo "${SNAP_RSTRING}" | cut -f2 -d ':')
#if Is_same_mount
fi
- Mount_device $DEV
- DEST="${MOUNTP}/${DEST}"
-
# check vars
if [ ! -d "${COW}" ]; then
Usage "Error: ${COW} is not a directory"
fi
+
+ Mount_device $DEV
+
}
Clean ()