Commit | Line | Data |
---|---|---|
25469895 P |
1 | #!/bin/sh |
2 | recipients="root+git" # adresse pour l'envoi du mail | |
3 | ||
4 | if [ "$1" != "cron" ]; then | |
5 | echo "Ce script n'est pas fait pour être lancé manuellement mais via cron." | |
6 | exit -1 | |
7 | fi | |
8 | ||
9 | [ -x /usr/bin/git -a -d /.git ] || exit 0 | |
10 | ||
11 | cd / | |
12 | ( | |
c80ec8d7 | 13 | echo "From: git `hostname --fqdn` - Cron Daemon <root+git@`cat /etc/mailname`>" |
25469895 P |
14 | echo "To: ${recipients}" |
15 | echo "Date: `date --rfc-2822`" | |
c80ec8d7 | 16 | echo "Subject: git-status: `hostname --fqdn` - $0" |
25469895 P |
17 | echo "Content-Type: text/plain; charset=utf-8" |
18 | echo "" | |
c80ec8d7 | 19 | echo "Voici la liste de modifications sur la machine `hostname --fqdn` qui n'ont pas encore été validées :" |
25469895 P |
20 | echo "( voir http://wiki.auf.org/wikiteki/Git/SuiviDeConfiguration )" |
21 | echo "" | |
22 | /usr/bin/git status -a | sed -e '/^nothing to commit/d' -e 's/^#//' | |
23 | ) | head -c 16k | /usr/sbin/sendmail ${recipients} | |
24 | exit 0 |