Added tape check
This commit is contained in:
parent
c8ba838f3a
commit
e656cb33f6
14
autotape.sh
14
autotape.sh
@ -35,17 +35,18 @@ Check_tape()
|
|||||||
TESTTAPE=`mt -f ${DRIVE} status | grep DR_OPEN`
|
TESTTAPE=`mt -f ${DRIVE} status | grep DR_OPEN`
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
echo "No tape in drive, aborting"
|
echo "No tape in drive, aborting"
|
||||||
exit 1
|
EXIT_STATE=1
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Tape seems to exist"
|
echo "Tape seems to exist"
|
||||||
exit 0
|
EXIT_STATE=0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
### Main routine ###
|
### Main routine ###
|
||||||
|
|
||||||
|
# Check and repeat until the tape drive is on
|
||||||
EXIT_STATE=3
|
EXIT_STATE=3
|
||||||
while [ ${EXIT_STATE} != 0 ]; do
|
while [ ${EXIT_STATE} != 0 ]; do
|
||||||
Check_drive
|
Check_drive
|
||||||
@ -53,3 +54,12 @@ while [ ${EXIT_STATE} != 0 ]; do
|
|||||||
sleep 20
|
sleep 20
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check and repeat until a tape is inserted
|
||||||
|
EXIT_STATE=3
|
||||||
|
while [ ${EXIT_STATE} != 0 ]; do
|
||||||
|
Check_tape
|
||||||
|
if [ ${EXIT_STATE} != 0 ]; then
|
||||||
|
sleep 20
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user