Update cron jobs and scripts.

This commit is contained in:
Darren 'Tadgy' Austin 2022-08-17 18:31:57 +01:00
commit e482a0eda1
4 changed files with 18 additions and 5 deletions

View file

@ -5,7 +5,6 @@ source /etc/mail.conf "etc-git" || exit 1
ETCSTATUS="$(cd /etc && git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")"
TEMPLATESTATUS="$(cd /etc/slackpkg/templates && git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")"
[[ -z "$ETCSTATUS" ]] && [[ -z "$TEMPLATESTATUS" ]] && exit 0
[[ ! -z "$ETCSTATUS" ]] || [[ ! -z "$TEMPLATESTATUS" ]] && {
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n'}$TEMPLATESTATUS"
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n\n'}$TEMPLATESTATUS"

View file

@ -0,0 +1,13 @@
#!/bin/bash
source /etc/mail.conf "mail-queue" || exit 1
hash mailq 2>/dev/null || exit 0
sleep $(( RANDOM % 180 ))
QUEUE="$(mailq)"
[[ -z "$QUEUE" ]] && exit 0
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "Mail queue" "${EMAIL_TO[@]}" <<< "$QUEUE"