addon-home-panel/home-panel/rootfs/etc/services.d/config/run
2018-08-18 14:53:23 +01:00

16 lines
594 B
Text

#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: Home Panel
# Keeps the config file up to date
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
config_file="/config/$(hass.config.get 'config_file')"
# shellcheck disable=SC2162
# shellcheck disable=SC2034
inotifywait -m "$config_file" | while read file; do \
hass.log.debug "Update Config.." \
&& cp "$config_file" /usr/src/api/files/config.json; \
done