mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Fix shebang test
This commit is contained in:
@@ -27,8 +27,10 @@ for SCRIPTS in /etc/cont-init.d/*; do
|
|||||||
# Get current shebang, if not available use another
|
# Get current shebang, if not available use another
|
||||||
currentshebang="$(sed -n '1{s/^#![[:blank:]]*//p;q}' "$SCRIPTS")"
|
currentshebang="$(sed -n '1{s/^#![[:blank:]]*//p;q}' "$SCRIPTS")"
|
||||||
if [ ! -f "${currentshebang%% *}" ]; then
|
if [ ! -f "${currentshebang%% *}" ]; then
|
||||||
for shebang in "/command/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/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%% *}" ] && [[ "${shebang%% *} echo \"yes\"" ]]; then
|
command_path="${shebang%% *}"
|
||||||
|
if [ -x "$command_path" ] && "$command_path" echo "yes" >/dev/null 2>&1; then
|
||||||
|
echo "Valid shebang: $shebang"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user