From c9bd43cd250f56aa5bddd90830679411349180a9 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Mon, 15 Aug 2022 14:54:26 +0100 Subject: [PATCH] Warn if /etc/slackpkg/templates has been updated. --- base-files/cron.daily/warn-git-status | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/base-files/cron.daily/warn-git-status b/base-files/cron.daily/warn-git-status index 5475ad4..6ffcadf 100755 --- a/base-files/cron.daily/warn-git-status +++ b/base-files/cron.daily/warn-git-status @@ -2,8 +2,10 @@ source /etc/mail.conf "etc-git" || exit 1 -cd /etc +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")" -OUTPUT="$(git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")" -[[ ! -z "$OUTPUT" ]] && mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "$OUTPUT" +[[ ! -z "$ETCSTATUS" ]] || [[ ! -z "$TEMPLATESTATUS" ]] && { + +mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n'}$TEMPLATESTATUS"