From 9bc2e6f382891db94487fd2ec2f5d8c5d189c3cc Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:09:18 +0200 Subject: [PATCH] Correct Shebang in scripts --- .templates/ha_entrypoint_modif.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.templates/ha_entrypoint_modif.sh b/.templates/ha_entrypoint_modif.sh index 442a87735..e02f4d638 100755 --- a/.templates/ha_entrypoint_modif.sh +++ b/.templates/ha_entrypoint_modif.sh @@ -38,7 +38,7 @@ fi mkdir -p /run/s6/container_environment # Check if shebang exists -for shebang in "/command/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/usr/bin/bash" "/usr/bin/sh" "/bin/bash" "/bin/sh"; do +for shebang in "/command/with-contenv bashio" "/usr/bin/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/usr/bin/bash" "/usr/bin/sh" "/bin/bash" "/bin/sh"; do if [ -f "${shebang%% *}" ]; then break fi @@ -47,6 +47,12 @@ done # Define shebang sed -i "s|/command/with-contenv bashio|$shebang|g" /ha_entrypoint.sh +# Correct for scripts +for files in /etc/cont-init.d/* /etc/services.d/*; do + sed -i "s|/command/with-contenv bashio|$shebang|g" "$files" + sed -i "s|/usr/bin/with-contenv bashio|$shebang|g" "$files" +done + # Avoid interference with LOG_LEVEL used in the app if [ -f /usr/lib/bashio/bashio.sh ]; then sed -i 's|{LOG_LEVEL:|{BASHIO_LOG_LEVEL:|g' /usr/lib/bashio/bashio.sh