fix: check upload file is exist before upload

(fixed #2)
This commit is contained in:
ttionya
2020-10-07 22:37:18 +08:00
parent 7e437a1884
commit dc91efcbc4
2 changed files with 33 additions and 6 deletions
+22
View File
@@ -53,6 +53,28 @@ function send_mail() {
fi
}
########################################
# Send mail.
# Arguments:
# backup successful
# mail content
########################################
function send_mail_content() {
if [[ "${MAIL_SMTP_ENABLE}" == "FALSE" ]]; then
return
fi
# successful
if [[ "$1" == "TRUE" && "${MAIL_WHEN_SUCCESS}" == "TRUE" ]]; then
send_mail "BitwardenRS Backup Success" "$2"
fi
# failed
if [[ "$1" == "FALSE" && "${MAIL_WHEN_FAILURE}" == "TRUE" ]]; then
send_mail "BitwardenRS Backup Failed" "$2"
fi
}
########################################
# Initialization environment variables.
# Arguments: