From 400930817b51030f9dd7b49bc6b276233763feab Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:57:54 +0100 Subject: [PATCH] Change symlink creation code https://github.com/alexbelgium/hassio-addons/issues/654 --- enedisgateway2mqtt/rootfs/etc/cont-init.d/99-run.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/enedisgateway2mqtt/rootfs/etc/cont-init.d/99-run.sh b/enedisgateway2mqtt/rootfs/etc/cont-init.d/99-run.sh index ce90ecce4..53cb7ff48 100755 --- a/enedisgateway2mqtt/rootfs/etc/cont-init.d/99-run.sh +++ b/enedisgateway2mqtt/rootfs/etc/cont-init.d/99-run.sh @@ -59,7 +59,8 @@ fi # Check if config file is there, or create one from template if [ -f "$CONFIGSOURCE" ]; then # Create symlink if not existing yet - [ ! -L /data/config.yaml ] && ln -sf "$CONFIGSOURCE" /data + [ -f /data/config.yaml ] && rm /data/config.yaml || true + ln -sf "$CONFIGSOURCE" /data || true bashio::log.info "Using config file found in $CONFIGSOURCE" # Check if yaml is valid @@ -88,13 +89,4 @@ echo " " bashio::log.info "Starting the app" echo " " -# Test mode -TZ=$(bashio::config "TZ") -if [ "$TZ" = "test" ]; then - echo "secret mode found, launching script in /config/test.sh" - cd /config || exit - chmod 777 test.sh - ./test.sh -fi - python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?"