diff --git a/mirror-wrapper b/mirror-wrapper index ab8b078..c810829 100755 --- a/mirror-wrapper +++ b/mirror-wrapper @@ -1,5 +1,5 @@ #!/bin/bash -# Version: 0.2.0 +# Version: 0.2.1 # Copyright (c) 2023-2026: # Darren 'Tadgy' Austin # Licensed under the terms of the GNU General Public License version 3. @@ -17,15 +17,12 @@ EMAIL_TO=("Systems' Administrator ") # Functions notify() { - if [[ -n "$EMAIL_FROM" ]] && (( "${#EMAIL_TO[@]}" != 0 )); then + [[ -n "$EMAIL_FROM" ]] && (( "${#EMAIL_TO[@]}" != 0 )) && { printf "%s: %s\\n%s: %s\\n%s:\\n%s\\n" "Exit code" "$ERR" "Logfile" "$LOGSDIR/$LOGFILE.xz" "Output" "$(<"$LOGSDIR/$LOGFILE")" | mail -r "$EMAIL_FROM" -s "Mirroring $1" "${EMAIL_TO[@]}" >/dev/null 2>&1 || { printf "%s: %s\\n" "${0##*/}" "mail command failed" >&2 return 1 } - else - printf "%s: %s\\n" "${0##*/}" "no sender and/or recipient configured for mail delivery" >&2 - return 1 - fi + } return 0 }