Added a sanity check () and changed test -b to test -e for tape device

This commit is contained in:
Jack-Benny Persson 2013-12-22 09:07:58 +01:00
parent f7c2ad534c
commit 7a1996c587

View File

@ -47,9 +47,15 @@ for i in $Ls $Tar $Sort $Tail $Uniq $Mount $Umount $Mt $Cp $Mkdir; do
fi
done
# Check that BackupDir exists
if [ ! -d $BackupDir ]; then
echo "$BackupDir dosen't seem to exist, aborting" > /dev/stderr
exit 2
fi
# Check that our tape drive is on and connected and a tape is inserted
if [ "$Where" = "Tape" ] || [ "$Where" = "Tape&HDD" ]; then
if [ ! -b $TapeDev ]; then
if [ ! -e $TapeDev ]; then
echo "$CurTime No tape device present at $TapeDev" > /dev/stderr
exit 2
fi