addon-home-panel/home-panel/rootfs/etc/cont-init.d/20-config.sh
2018-08-19 17:49:33 +01:00

20 lines
757 B
Bash

#!/usr/bin/with-contenv bash
# ==============================================================================
# Timmo Hass.io Add-ons: Home Panel
# This copies the configs to their respective locations
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
config_file="/config/$(hass.config.get 'config_file')"
if [ ! -f "$config_file" ]; then
hass.log.info "Config file does not exist. Creating.."
cp /etc/home-panel/home-panel-config.default.json "$config_file"
hass.log.info "Created. You should now edit this file at '$config_file'"
fi
hass.log.info "Copy config to API.."
mkdir -p /usr/src/api/files
cp "$config_file" /usr/src/api/files/config.json