Update do-backup for userdirs. Remove ''s around from= for mailx.

This commit is contained in:
Darren 'Tadgy' Austin 2023-11-06 15:35:26 +00:00
commit 25394932fb
4 changed files with 41 additions and 10 deletions

View file

@ -53,7 +53,7 @@ printf "\\n" >>"$LOGSDIR/$LOGFILE"
# Tell the sysadmin what went on.
if (( "$ERR" == 0 )); then
if [[ -n "${EMAIL_TO[*]}" ]]; then
mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "SBosrcarch report" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \
mailx "${MAILX_ARGS[@]}" -S "from=$EMAIL_FROM" -s "SBosrcarch report" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \
{ printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; }
Exit code: $ERR
Logfile: $LOGSDIR/$LOGFILE.gz
@ -68,7 +68,7 @@ else
# Updating failed, tell the admin.
[[ -x "/opt/bin/pushover" ]] && CONFIG_FILE="mirroring" /opt/bin/pushover -T "SBosrcarch" -p '-1' -m "SBosrcarch failed"
if [[ -n "${EMAIL_TO[*]}" ]]; then
mailx "${MAILX_ARGS[@]}" -S "from='$EMAIL_FROM'" -s "SBosrcarch failure" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \
mailx "${MAILX_ARGS[@]}" -S "from=$EMAIL_FROM" -s "SBosrcarch failure" "${EMAIL_TO[@]}" <<-EOF 2>/dev/null || \
{ printf "%s: %s\\n" "${0##*/}" "mailx command failed" >&2; RET=1; }
Exit code: $ERR
Logfile: $LOGSDIR/$LOGFILE.gz