From 585a957a9e4509cc1ddf3f5326e7f2e16751f492 Mon Sep 17 00:00:00 2001 From: Timmo Date: Sat, 6 Oct 2018 22:38:37 +0100 Subject: [PATCH] :hammer: remove symlink and run api with custom paths --- home-panel/rootfs/etc/cont-init.d/20-config.sh | 6 ------ home-panel/rootfs/etc/cont-init.d/30-api.sh | 7 ------- home-panel/rootfs/etc/services.d/api/run | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/home-panel/rootfs/etc/cont-init.d/20-config.sh b/home-panel/rootfs/etc/cont-init.d/20-config.sh index 94a82a5..151fd63 100644 --- a/home-panel/rootfs/etc/cont-init.d/20-config.sh +++ b/home-panel/rootfs/etc/cont-init.d/20-config.sh @@ -13,9 +13,3 @@ if [ ! -f "$config_file" ]; then 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 - -if [ ! -f "/usr/src/api/files/config.json" ]; then - hass.log.info "Symlink config to API directory.." - mkdir -p /usr/src/api/files - ln -sf "$config_file" /usr/src/api/files/config.json -fi diff --git a/home-panel/rootfs/etc/cont-init.d/30-api.sh b/home-panel/rootfs/etc/cont-init.d/30-api.sh index 51075f7..9096bb9 100644 --- a/home-panel/rootfs/etc/cont-init.d/30-api.sh +++ b/home-panel/rootfs/etc/cont-init.d/30-api.sh @@ -14,10 +14,3 @@ if hass.config.true 'ssl'; then cp "$certfile" /usr/src/api/fullchain.pem cp "$keyfile" /usr/src/api/privkey.pem fi - -if [ ! -f "/config/home-panel.db" ]; then - hass.log.info "Symlink DB to API directory.." - touch /config/home-panel.db - mkdir -p /usr/src/api/files - ln -sf "/config/home-panel.db" /usr/src/api/files/home-panel.db -fi diff --git a/home-panel/rootfs/etc/services.d/api/run b/home-panel/rootfs/etc/services.d/api/run index 1104f3e..1079591 100644 --- a/home-panel/rootfs/etc/services.d/api/run +++ b/home-panel/rootfs/etc/services.d/api/run @@ -11,4 +11,4 @@ hass.log.info "Run API.." # shellcheck disable=SC2164 cd /usr/src/api -node index.js +DB_PATH=/config/home-panel.db CONFIG_PATH=/config/$(hass.config.get 'config_file') node index.js