better error messages

This commit is contained in:
rootzoll 2020-02-24 18:43:03 +01:00
parent 877f3758fb
commit e3e0ccc156

View file

@ -46,16 +46,25 @@ source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
# check if HDD is mounted # check if HDD is mounted
if [ ${isMounted} -eq 0 ]; then if [ ${isMounted} -eq 0 ]; then
echo "FAIL - HDD is not mounted" echo "error='HDD is not mounted'"
exit 1 exit 1
fi fi
# check if HDD is big enough # check if HDD is big enough
if [ ${hddGigaBytes} -lt 800 ]; then if [ ${hddGigaBytes} -lt 800 ]; then
echo "FAIL - HDD is too small to run copy station (+/- 1TB needed)" echo "# To run copy station (+/- 1TB needed)"
echo "error='HDD is too small'"
exit 1 exit 1
fi fi
# check that path information is valid
if [ -d "$pathBitcoinBlockchain" ]; then
echo "# OK found $pathBitcoinBlockchain"
else
echo "# FAIL path of 'pathBitcoinBlockchain' does not exists: ${pathBitcoinBlockchain}"
echo "error='pathBitcoinBlockchain nit found'"
exit 1
fi
# make sure that its running in screen # make sure that its running in screen
# call with '-foreground' to prevent running in screen # call with '-foreground' to prevent running in screen
@ -82,14 +91,6 @@ echo
echo "*** CHECKING CONFIG" echo "*** CHECKING CONFIG"
# check that path information is valid
if [ -d "$pathBitcoinBlockchain" ]; then
echo "OK found $pathBitcoinBlockchain"
else
echo "FAIL path of 'pathBitcoinBlockchain' does not exists: ${pathBitcoinBlockchain}"
exit 1
fi
# check that path information is valid # check that path information is valid
if [ -d "$pathTemplateHDD" ]; then if [ -d "$pathTemplateHDD" ]; then
echo "OK found $pathTemplateHDD" echo "OK found $pathTemplateHDD"