Deletion of mailevomaintenance.sh
We now use the git status cron for uncommited changes
This commit is contained in:
parent
10d56cad1e
commit
29afa42c3d
|
@ -28,24 +28,3 @@
|
||||||
backup: no
|
backup: no
|
||||||
tags:
|
tags:
|
||||||
- evomaintenance
|
- 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
|
|
||||||
|
|
|
@ -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
|
|
Loading…
Reference in a new issue