mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-13 03:11:02 +01:00
allow setting ssl without preexisting certificate line
This commit is contained in:
@@ -25,7 +25,10 @@ echo "... adding ssl certs in files"
|
||||
#Sets certificates
|
||||
for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do
|
||||
if [ -f $NGINXFILE ]; then
|
||||
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
|
||||
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE):
|
||||
if [ -z $LINE ]; then
|
||||
LINE=$(sed -n "/listen 443/=" $NGINXFILE):
|
||||
fi
|
||||
if [ ! -z $LINE ]; then
|
||||
sed -i "/ssl_certificate/ d" $NGINXFILE
|
||||
sed -i "$LINE a ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
|
||||
|
||||
Reference in New Issue
Block a user