From 60031750c52c77a0e8eac37fec8aa3a0eed6f893 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 2 Mar 2025 14:30:28 +0100 Subject: [PATCH] Fix shebang test --- .templates/ha_entrypoint_modif.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.templates/ha_entrypoint_modif.sh b/.templates/ha_entrypoint_modif.sh index 76be60752..205c5362a 100755 --- a/.templates/ha_entrypoint_modif.sh +++ b/.templates/ha_entrypoint_modif.sh @@ -44,6 +44,14 @@ for shebang in "/command/with-contenv bashio" "/usr/bin/with-contenv bashio" "/u fi done +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 + command_path="${shebang%% *}" + if [ -x "$command_path" ] && "$command_path" echo "yes" >/dev/null 2>&1; then + echo "Valid shebang: $shebang" + break + fi +done + # Define shebang sed -i "s|/command/with-contenv bashio|$shebang|g" /ha_entrypoint.sh