diff options
author | Josep Puigdemont <josep.puigdemont@enea.com> | 2016-03-09 17:29:41 +0100 |
---|---|---|
committer | Josep Puigdemont <josep.puigdemont@enea.com> | 2016-03-09 17:43:15 +0100 |
commit | cf4545d8d0709bcd7cb32cbfc9d7988d558d8065 (patch) | |
tree | 944661f0bea739f6d53128e371e51bf935adeb5a | |
parent | 41679c5e444c7479b3fbad4b9e6749623c907275 (diff) |
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 <josep.puigdemont@enea.com>
-rwxr-xr-x | utils/jenkins-jnlp-connect.sh | 9 |
1 files changed, 6 insertions, 3 deletions
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 "$@" |