From cf4545d8d0709bcd7cb32cbfc9d7988d558d8065 Mon Sep 17 00:00:00 2001 From: Josep Puigdemont Date: Wed, 9 Mar 2016 17:29:41 +0100 Subject: Change the way to detect monit configuration dir Instead of finding out the Linux distribution of the host, try whether one of the well known monit configuration directories exist, and use that. Change-Id: Ibb111661fb3a6ef8e4b4ef559b9a1d56599d59c8 Signed-off-by: Josep Puigdemont --- utils/jenkins-jnlp-connect.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'utils') diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh index 6fb6827fd..e0c6ff2e0 100755 --- a/utils/jenkins-jnlp-connect.sh +++ b/utils/jenkins-jnlp-connect.sh @@ -48,10 +48,14 @@ if [[ $(whoami) != "root" && $(whoami) != "$jenkinsuser" ]]; then exit 1 fi -if [[ $distro == Debian || $distro == Ubuntu ]]; then +if [ -d /etc/monit/conf.d ]; then monitconfdir="/etc/monit/conf.d/" -elif [[ $distro == Fedora || $distro == CentOS || $distro == Redhat ]]; then +elif [ -d /etc/monit.d ]; then monitconfdir="/etc/monit.d" +else + echo "Could not determine the location of the monit configuration file." + echo "Make sure monit is installed." + exit 1 fi #make pid dir @@ -186,6 +190,5 @@ do done connectionstring="java -jar slave.jar -jnlpUrl https://build.opnfv.org/ci/computer/"$slave_name"/slave-agent.jnlp -secret "$slave_secret" -noCertificateCheck " -distro="$(tr -s ' \011' '\012' < /etc/issue | head -n 1)" main "$@" -- cgit 1.2.3-korg