Deletion of mailevomaintenance.sh

We now use the git status cron for uncommited changes
This commit is contained in:
Jérémy Dubois 2020-04-21 11:30:40 +02:00
parent 10d56cad1e
commit 29afa42c3d
2 changed files with 0 additions and 49 deletions

View File

@ -28,24 +28,3 @@
backup: no
tags:
- evomaintenance
- name: Copy mailevomaintenance
template:
src: mailevomaintenance.sh.j2
dest: /usr/share/scripts/mailevomaintenance.sh
owner: root
group: wheel
mode: "0700"
tags:
- evomaintenance
- mailevomaintenance
- name: Add mailevomaintenance cron
cron:
name: "mailevomaintenance"
job: "/usr/share/scripts/mailevomaintenance.sh"
minute: "50"
hour: "22"
disabled: yes
tags:
- mailevomaintenance

View File

@ -1,28 +0,0 @@
#!/bin/sh
set -eu
cd /etc && _STATUS=$(/usr/local/bin/git status --porcelain)
[ -n "${_STATUS}" ] || exit 0
if [ -e /etc/realname ]; then
_HOSTNAME=$(/bin/cat /etc/realname)
else
_HOSTNAME=$(/bin/hostname)
fi
TMPFILE=$(/usr/bin/mktemp) || exit 1
echo "Dear NOC,\n\nSome changes in /etc/ were not committed." >> $TMPFILE
echo "" >> $TMPFILE
echo "${_STATUS}" >> $TMPFILE
echo "" >> $TMPFILE
/usr/bin/last | head -n 10 >> $TMPFILE
echo "" >> $TMPFILE
echo "Please answer this mail to notify people when you've corrected the problem." >> $TMPFILE
/bin/cat $TMPFILE | mail -s "Verif etc-git ${_HOSTNAME}" noc@{{ evomaintenance_realm }}
/bin/rm $TMPFILE