Add testFichierPresent

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1774 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-01 06:53:23 +00:00
parent a2555c1552
commit 43e0dad387
2 changed files with 15 additions and 0 deletions

11
check
View File

@@ -305,6 +305,17 @@ function testZombie()
done
}
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"
/etc/init.d/$2 stop
/etc/init.d/$2 start
fi
}
if [ ! -f "/etc/check.conf" ]; then
echo "Le fichier /etc/check.conf n'existe pas : EXIT"
exit