From 4bd03ecc0a6a482fdd5c6f8a96e5ba5b33e90b03 Mon Sep 17 00:00:00 2001 From: Mirza Krak Date: Wed, 7 Aug 2019 13:02:42 +0000 Subject: [PATCH] only install servert.crt.demo if --demo-host-ip/-i is set --demo-host-ip/-i would imply that the intention is to use the demo server, otherwise we do not not want to install the demo certificate. Changelog: Title Signed-off-by: Mirza Krak --- convert-stage-4.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/convert-stage-4.sh b/convert-stage-4.sh index 7e40fd4..2f5ec81 100755 --- a/convert-stage-4.sh +++ b/convert-stage-4.sh @@ -193,17 +193,16 @@ install_files() { sudo sh -c -e "echo artifact_name=${artifact_name} > ${primary_dir}/${sysconfdir}/artifact_info"; fi - # Set demo server + # Set demo server and install demo certificate if [ -n "${demo_host_ip}" ]; then sudo sh -c -e "echo '$demo_host_ip docker.mender.io s3.docker.mender.io' >> $primary_dir/etc/hosts"; jq_inplace '.ServerURL = \"https://docker.mender.io\"' ${primary_dir}/${sysconfdir}/mender.conf + sudo install -m 0444 ${mender_dir}/server.demo.crt ${primary_dir}/${sysconfdir}/server.crt fi - # Install provided or demo certificate + # Install provided if [ -n "${server_cert}" ]; then sudo install -m 0444 ${server_cert} ${primary_dir}/${sysconfdir}/server.crt - else - sudo install -m 0444 ${mender_dir}/server.demo.crt ${primary_dir}/${sysconfdir}/server.crt fi }