From: Ralph Ronnquist Date: Tue, 9 Nov 2021 22:50:06 +0000 (+1100) Subject: use /backup as default X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=d6fc08311a092f201086078482c71d62fc728410;p=rrq%2Fnilfs2sss.git use /backup as default --- 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