Optimized exits

This commit is contained in:
Kevin Veen-Birkenbach 2023-06-28 21:32:09 +02:00
parent 7832c85de7
commit 5786e21c11

View File

@ -38,9 +38,8 @@ if [ -f "$backup_sql" ]; then
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Failed to recover mysql dump" echo "ERROR: Failed to recover mysql dump"
exit 1 exit 1
else
exit 0
fi fi
exit 0
fi fi
echo "A database backup exists, but a parameter is missing. Files will be recovered instead." echo "A database backup exists, but a parameter is missing. Files will be recovered instead."
fi fi
@ -52,6 +51,7 @@ if [ -d "$backup_files" ]; then
echo "ERROR: Failed to recover files" echo "ERROR: Failed to recover files"
exit 1 exit 1
fi fi
exit 0
else else
echo "ERROR: $backup_files doesn't exist" echo "ERROR: $backup_files doesn't exist"
exit 1 exit 1