bootstrap/base-files/cron.daily/warn-git-status

10 lines
493 B
Bash
Executable file

#!/bin/bash
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
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "/etc git status" "${EMAIL_TO[@]}" <<< "${ETCSTATUS:+$ETCSTATUS$'\n\n'}$TEMPLATESTATUS"