From 359784285460e067d0aad154b366187665a1f2e7 Mon Sep 17 00:00:00 2001 From: Josep Puigdemont Date: Thu, 10 Mar 2016 16:39:48 +0100 Subject: [PATCH] jenkins-jnlp-connect.sh: monit config file was always updated The jenkins-jnlp-connect.sh script will check whether a monit configuration file for jenkins exists. If it does, it will make sure the contents are correct according to the paramters provided in the command line. The check is made diffing the contents of the file with what is expected by the script. However the script compares the contents of the file against a string that is not exactly the same to what would be written to the file by the script, resulting in the check always failing, and the file being rewritten unnecessarily every time. Change-Id: I0b15195e9d667c11898942c92b39ef3fb053821d Signed-off-by: Josep Puigdemont --- utils/jenkins-jnlp-connect.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh index ec31a4aa7..10ac50b0a 100755 --- a/utils/jenkins-jnlp-connect.sh +++ b/utils/jenkins-jnlp-connect.sh @@ -100,8 +100,8 @@ if [[ -f $monitconfdir/jenkins ]]; then #test for diff if [[ "$(diff $monitconfdir/jenkins <(echo "\ check process jenkins with pidfile /var/run/$jenkinsuser/jenkins_jnlp_pid -start program = \"usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; export started_monit=true; $0 $@'\" -stop program = \" /bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'\"\ +start program = \"/usr/bin/sudo -u $jenkinsuser /bin/bash -c 'cd $dir; export started_monit=true; $0 $@'\" +stop program = \"/bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)'\"\ ") )" ]]; then echo "Updating monit config..." makemonit $@ -- 2.16.6