Version 2.02.150 -
=================================
+ Allow the lvmdump directory to exist already provided it is empty.
Version 2.02.149 - 1st April 2016
=================================
dir="$HOME/$dirbase"
fi
-test -e $dir && die 3 "Fatal: $dir already exists"
-$MKDIR -p $dir || die 4 "Fatal: could not create $dir"
+if test -d $dir ; then
+ (shopt -s nullglob dotglob; cd $dir && files=(*) && ((${#files[@]}))) && die 5 "Fatal: directory $dir already exists and is not empty"
+else
+ test -e $dir && die 3 "Fatal: $dir already exists"
+ $MKDIR -p $dir || die 4 "Fatal: could not create $dir"
+fi
log="$dir/lvmdump.log"