Correct Shebang in scripts

This commit is contained in:
Alexandre
2024-04-13 16:09:18 +02:00
committed by GitHub
parent 84a0c37f91
commit 9bc2e6f382

View File

@@ -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