summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosep Puigdemont <josep.puigdemont@enea.com>2016-03-10 16:39:48 +0100
committerJosep Puigdemont <josep.puigdemont@enea.com>2016-03-10 16:39:48 +0100
commit359784285460e067d0aad154b366187665a1f2e7 (patch)
treee9cdaee81d92753668695c792f57c7bfb78a45e6
parentf95330c3b0fea7fb2981ef95a20f06eff5542b7c (diff)
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 <josep.puigdemont@enea.com>
-rwxr-xr-xutils/jenkins-jnlp-connect.sh4
1 files 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 $@