Browse Source

Merge pull request #114 from lluiscampos/cherry-pick-MEN-2640-to-1.1.x

Demo cert fixes: MEN-2640 to 1.1.x
1.1.x
Lluis Campos 5 years ago
committed by GitHub
parent
commit
40f35b4034
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      convert-stage-4.sh

11
convert-stage-4.sh

@ -180,17 +180,20 @@ install_files() {
sudo sh -c -e "echo artifact_name=${artifact_name} > ${primary_dir}/${sysconfdir}/artifact_info"; sudo sh -c -e "echo artifact_name=${artifact_name} > ${primary_dir}/${sysconfdir}/artifact_info";
fi fi
# Set demo server # Set demo server and install demo certificate
if [ -n "${demo_host_ip}" ]; then 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"; 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 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 fi
# Install provided or demo certificate # Install provided
if [ -n "${server_cert}" ]; then if [ -n "${server_cert}" ]; then
sudo install -m 0444 ${server_cert} ${primary_dir}/${sysconfdir}/server.crt sudo install -m 0444 ${server_cert} ${primary_dir}/${sysconfdir}/server.crt
else fi
sudo install -m 0444 ${mender_dir}/server.demo.crt ${primary_dir}/${sysconfdir}/server.crt
if [ -e "${primary_dir}/${sysconfdir}/server.crt" ]; then
jq_inplace '.ServerCertificate = \"/'${sysconfdir}'/server.crt\"' ${primary_dir}/${sysconfdir}/mender.conf
fi fi
} }

Loading…
Cancel
Save