From d6fc08311a092f201086078482c71d62fc728410 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 10 Nov 2021 09:50:06 +1100 Subject: [PATCH] use /backup as default --- ssbrowse.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ssbrowse.sh b/ssbrowse.sh index 82a7b37..d9c06b6 100755 --- a/ssbrowse.sh +++ b/ssbrowse.sh @@ -2,8 +2,7 @@ # # 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-$$ @@ -11,18 +10,19 @@ mkdir -p $MOUNT || exit 1 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 -- 2.39.2