Exit on failed file checks

This commit is contained in:
Tom Pansino
2021-02-18 00:35:06 -08:00
parent 46fddb533c
commit 912e60edd8

View File

@@ -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