#
# Browse snapshots of a given path and run meld to compare with
# current directory
-# $1: path -- into mounted nilfs
-# $2: [path] -- to compare with
+# $1: path -- for mounted nilfs
## Prepare for mounting of snapshots
MOUNT=/tmp/ssmeld-$$
function exitbrowse() {
umount $MOUNT 2>/dev/null
- rmdir -f $MOUNT
+ rmdir $MOUNT
trap "" 0
}
trap "exitbrowse" 0 2 9 15
-DF=( $(df $1 | awk '{d=$1;p=$NF;} END {printf "%s %s", d, p;}') )
+ARG1="${1-/backup}"
+DF=( $(df $ARG1 | awk '{d=$1;p=$NF;} END {printf "%s %s", d, p;}') )
-NILFSROOT=${DF[1]}
-NILFSDEV=${DF[0]}
-PTR="${1#$NILFSROOT}"
-DIR0=$MOUNT$PTR
-DIR1=$NILFSROOT
+NILFSROOT="${DF[1]}"
+NILFSDEV="${DF[0]}"
+PTR="${ARG1#$NILFSROOT}"
+DIR0="$MOUNT$PTR"
+DIR1="$NILFSROOT"
function snap2iselect() {
lscp -r -s $NILFSDEV | while read CNO DATE TIME REST ; do