Browse Source

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 <mirza.krak@northern.tech>
1.2.x
Mirza Krak 6 years ago
parent
commit
4bd03ecc0a
  1. 7
      convert-stage-4.sh

7
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
}

Loading…
Cancel
Save