Keep shebang if s6 supervision

This commit is contained in:
Alexandre
2022-01-17 13:25:10 +01:00
parent a22ce94a46
commit d544d731a7
17 changed files with 34 additions and 17 deletions

View File

@@ -10,6 +10,7 @@ for SCRIPTS in /etc/cont-init.d/*; do
echo "$SCRIPTS: executing"
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
chmod a+x "$SCRIPTS"
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" || true
# Change shebang if no s6 supervision
if [ -d /etc/s6 ]; then sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS"; fi
/./"$SCRIPTS" || echo "$SCRIPTS: exiting $?"
done