esphome/esphomeyaml-edge/rootfs/etc/cont-init.d/20-nginx.sh
Otto Winter a8c17e5d05
Fix host network (#280)
* Fix Add-On host network mode

* Split up esphomeyaml tests

* Fix perms

* Fix

* Add esphomeyaml_version option

* Revert change to travis.yml
2019-01-02 12:21:26 +01:00

29 lines
843 B
Bash
Executable File

#!/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
declare port
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
port=$(hass.config.get 'port')
sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf