check hdd before starting screen

This commit is contained in:
rootzoll 2020-02-24 18:40:25 +01:00
parent 48880bc622
commit 877f3758fb

View File

@ -41,6 +41,22 @@ if [ "$EUID" -ne 0 ]; then
exit 1
fi
# get HDD info
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
# check if HDD is mounted
if [ ${isMounted} -eq 0 ]; then
echo "FAIL - HDD is not mounted"
exit 1
fi
# check if HDD is big enough
if [ ${hddGigaBytes} -lt 800 ]; then
echo "FAIL - HDD is too small to run copy station (+/- 1TB needed)"
exit 1
fi
# make sure that its running in screen
# call with '-foreground' to prevent running in screen
if [ "$1" != "-foreground" ]; then
@ -74,21 +90,6 @@ else
exit 1
fi
# get HDD info
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
# check if HDD is mounted
if [ ${isMounted} -eq 0 ]; then
echo "FAIL - HDD is not mounted"
exit 1
fi
# check if HDD is big enough
if [ ${hddGigaBytes} -lt 800 ]; then
echo "FAIL - HDD is too small to run copy station (+/- 1TB needed)"
exit 1
fi
# check that path information is valid
if [ -d "$pathTemplateHDD" ]; then
echo "OK found $pathTemplateHDD"