Browse Source

Merge pull request #108 from mirzak/servert-crt-file

MEN-2640: mender-convert does not add demo cert to mender.conf
1.2.x
Mirza Krak 6 years ago
committed by GitHub
parent
commit
1f2bf8976b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      convert-stage-4.sh

11
convert-stage-4.sh

@ -193,17 +193,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 = \"'${primary_dir}'/'${sysconfdir}'/server.crt\"' ${primary_dir}/${sysconfdir}/mender.conf
fi fi
} }

Loading…
Cancel
Save