„Cert2FritzBox.sh“ ändern

This commit is contained in:
Stephan 2019-11-13 09:41:01 +00:00
parent 34147a585b
commit dc151cd78f
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
#!/bin/bash
# https://gist.github.com/wikrie/f1d5747a714e0a34d0582981f7cb4cfb
# https://www.ip-phone-forum.de/threads/lets-encrypt-zertifikat-auf-der-fritzbox.282964/page-2#post-2145225
# Parameter
DOMAIN="example.org"
@ -48,10 +49,12 @@
printf -- "--$BOUNDARY\r\n" >> $TMP
printf "Content-Disposition: form-data; name=\"BoxCertImportFile\"; filename=\"BoxCert.pem\"\r\n" >> $TMP
printf "Content-Type: application/octet-stream\r\n\r\n" >> $TMP
cat $CERTPATH/cert.pem >> $TMP
echo -e >> $TMP # 2019-11: in cert.pem fehlt der letzt Zeilenumbruch / der Import ist zwar erfolgreich, allerdings fehlt das Cert in der FritzBoxGUI
cat $CERTPATH/chain.pem >> $TMP
cat $CERTPATH/privkey.pem >> $TMP
# cat $CERTPATH/cert.pem >> $TMP
# echo -e >> $TMP # 2019-11: in cert.pem fehlt der letzt Zeilenumbruch / der Import ist zwar erfolgreich, allerdings fehlt das Cert in der FritzBoxGUI
# cat $CERTPATH/chain.pem >> $TMP
# cat $CERTPATH/privkey.pem >> $TMP
cat $CERTPATH/privkey.pem >> $TMP
cat $CERTPATH/fullchain.pem >> $TMP
printf "\r\n" >> $TMP
printf -- "--$BOUNDARY--" >> $TMP