mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 17:27:45 +01:00
25 lines
746 B
Bash
25 lines
746 B
Bash
|
#!/usr/bin/with-contenv bash
|
||
|
# ==============================================================================
|
||
|
# Community Hass.io Add-ons: esphomeyaml
|
||
|
# Configures NGINX for use with esphomeyaml
|
||
|
# ==============================================================================
|
||
|
# shellcheck disable=SC1091
|
||
|
source /usr/lib/hassio-addons/base.sh
|
||
|
|
||
|
declare certfile
|
||
|
declare keyfile
|
||
|
|
||
|
mkdir -p /var/log/nginx
|
||
|
|
||
|
# Enable SSL
|
||
|
if hass.config.true 'ssl'; then
|
||
|
rm /etc/nginx/nginx.conf
|
||
|
mv /etc/nginx/nginx-ssl.conf /etc/nginx/nginx.conf
|
||
|
|
||
|
certfile=$(hass.config.get 'certfile')
|
||
|
keyfile=$(hass.config.get 'keyfile')
|
||
|
|
||
|
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
|
||
|
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
|
||
|
fi
|