From 04a07d4cb762b36d3adce5e2e10846cbb4b4e5d5 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 27 Dec 2022 14:33:01 +0100 Subject: [PATCH] Update 01-custom_script.sh --- .templates/01-custom_script.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.templates/01-custom_script.sh b/.templates/01-custom_script.sh index 4a5e5afa5..1ceb81034 100755 --- a/.templates/01-custom_script.sh +++ b/.templates/01-custom_script.sh @@ -2,12 +2,20 @@ # shellcheck shell=bash slug="${HOSTNAME#*-}" -bashio::log.info "Execute /config/${slug}.sh if existing" +bashio::log.info "Execute /config/addons_autoscripts/${slug}.sh if existing" +mkdir -p /config/addons_autoscripts + +# Migrate scripts if [ -f /config/"${slug}".sh ]; then + mv -f /config/"${slug}".sh /config/addons_autoscripts/"${slug}".sh +fi + +# Execute scripts +if [ -f /config/addons_autoscripts/"${slug}".sh ]; then bashio::log.info "... script found, executing" - chmod +x /config/"${slug}".sh - /./config/"${slug}".sh + chmod +x /config/addons_autoscripts/"${slug}".sh + /./config/addons_autoscripts/"${slug}".sh else bashio::log.info "... no script found" fi