Fix permissions on secret.key

PROD-34412

Change-Id: I7f0b9f1e9c6e34ae7c684cddc0019f0f6e2dae44
diff --git a/jenkins.sh b/jenkins.sh
index a2cddc8..05a86be 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -13,7 +13,8 @@
 export JENKINSTHEME_CSS_URL=${JENKINSTHEME_CSS_URL:-$JENKINS_URL_PREFIX/userContent/theme/mirantis.min.css}
 export JENKINSTHEME_JS_URL=${JENKINSTHEME_JS_URL:-$JENKINS_URL_PREFIX/userContent/theme/mirantis.min.js}
 [ -f $JENKINS_HOME/org.codefirst.SimpleThemeDecorator.xml ] || cat /opt/org.codefirst.SimpleThemeDecorator.xml | envsubst > $JENKINS_HOME/org.codefirst.SimpleThemeDecorator.xml
-
+[ ! -e $JENKINS_HOME/secret.key ] && echo -n $(openssl rand -hex 32) > $JENKINS_HOME/secret.key # echo without EOL symbol
+chmod 0600 $JENKINS_HOME/secret.key
 
 # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments
 if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then