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

10 lines
504 B
Bash
Executable file

#!/bin/bash
source /etc/mail.conf "git-status" || exit 1
CONFIGSTATUS="$(cd / && 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 "$CONFIGSTATUS" ]] && [[ -z "$TEMPLATESTATUS" ]] && exit 0
mailx "${MAILX_ARGS[@]}" -r "$EMAIL_FROM" -s "git statuses" "${EMAIL_TO[@]}" <<<"${CONFIGSTATUS:+$CONFIGSTATUS$'\n'$'\n'}$TEMPLATESTATUS"