From 11c3fb31ff1d3b560dd67be192cb335078624ac2 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 1 Sep 2014 06:57:11 +0000 Subject: [PATCH] =?UTF-8?q?V=C3=A9rifie=20la=20pr=C3=A9sence=20du=20lanceu?= =?UTF-8?q?r=20dans=20testFichierPresent=20avant=20l'usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1775 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- check | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/check b/check index 4fe152e..b041108 100755 --- a/check +++ b/check @@ -309,8 +309,10 @@ function testFichierPresent { # Cette fonction teste si le fichier passé en premier argument est disponible # Si ce n'est pas le cas, relance le programme passé en deuxième paramètre - if [ ! -f "$1" ]; then - checklog "Fichier $1 absent : relance $2" + if [ ! -e "/etc/init.d/$2" ]; then + checklog "ERREUR : /etc/init.d/$2 introuvable (testFichierPresent)" + elif [ ! -f "$1" ]; then + checklog "ERREUR : Fichier $1 absent : relance $2" /etc/init.d/$2 stop /etc/init.d/$2 start fi