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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
4 deletions
-
convert-stage-4.sh
|
|
@ -193,17 +193,20 @@ 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 |
|
|
|
|
|
|
|
if [ -e "${primary_dir}/${sysconfdir}/server.crt" ]; then |
|
|
|
jq_inplace '.ServerCertificate = \"'${primary_dir}'/'${sysconfdir}'/server.crt\"' ${primary_dir}/${sysconfdir}/mender.conf |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|