mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
Exit on failed file checks
This commit is contained in:
@@ -331,10 +331,16 @@ check_availability() {
|
|||||||
"sqlite3" )
|
"sqlite3" )
|
||||||
if [[ ! -e "${dbhost}" ]]; then
|
if [[ ! -e "${dbhost}" ]]; then
|
||||||
print_error "File '${dbhost}' does not exist."
|
print_error "File '${dbhost}' does not exist."
|
||||||
|
exit_code=2
|
||||||
|
exit $exit_code
|
||||||
elif [[ ! -f "${dbhost}" ]]; then
|
elif [[ ! -f "${dbhost}" ]]; then
|
||||||
print_error "File '${dbhost}' is not a file."
|
print_error "File '${dbhost}' is not a file."
|
||||||
|
exit_code=2
|
||||||
|
exit $exit_code
|
||||||
elif [[ ! -r "${dbhost}" ]]; then
|
elif [[ ! -r "${dbhost}" ]]; then
|
||||||
print_error "File '${dbhost}' is not readable."
|
print_error "File '${dbhost}' is not readable."
|
||||||
|
exit_code=2
|
||||||
|
exit $exit_code
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user