From 76919c964939cf3fb1a5a7a59b44df5d3951efd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Wed, 14 Aug 2019 10:10:08 +0200 Subject: [PATCH] etc-git: Be sure that git status is not empty before sending a mail --- etc-git/files/etc-git-status.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc-git/files/etc-git-status.sh b/etc-git/files/etc-git-status.sh index 806d7977..1b78f138 100644 --- a/etc-git/files/etc-git-status.sh +++ b/etc-git/files/etc-git-status.sh @@ -34,7 +34,8 @@ fi # Send the mail if git status not empty git --git-dir=/etc/.git --work-tree=/etc status --short > $gitOutput -if [ $gitOuput -n ]; then +gitOutputNumber=$(wc -l $gitOutput | awk '{ print $1 }') +if [ $gitOutputNumber -gt 0 ]; then cat << EOT > $template Content-Type: text/plain; charset="utf-8" Reply-To: Équipe Evolix