mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-28 11:24:04 +02:00
Merge pull request #2626 from alexbelgium/copilot/fix-grep-option-error
Fix BusyBox grep -Z incompatibility in standalone mode init
This commit is contained in:
@@ -17,8 +17,8 @@ if ! bashio::supervisor.ping 2>/dev/null; then
|
|||||||
bashio::log.blue "Config source: ENV + /data/options.json"
|
bashio::log.blue "Config source: ENV + /data/options.json"
|
||||||
bashio::log.blue '-----------------------------------------------------------'
|
bashio::log.blue '-----------------------------------------------------------'
|
||||||
cp -rf /usr/local/lib/bashio-standalone.sh /usr/bin/bashio
|
cp -rf /usr/local/lib/bashio-standalone.sh /usr/bin/bashio
|
||||||
grep -rlZ "^#!.*bashio" /etc |
|
grep -rl "^#!.*bashio" /etc |
|
||||||
while IFS= read -r -d '' f; do
|
while IFS= read -r f; do
|
||||||
grep -qF "source /usr/local/lib/bashio-standalone.sh" "$f" && continue
|
grep -qF "source /usr/local/lib/bashio-standalone.sh" "$f" && continue
|
||||||
sed -i '1a source /usr/local/lib/bashio-standalone.sh' "$f"
|
sed -i '1a source /usr/local/lib/bashio-standalone.sh' "$f"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ if [ -d /etc/cont-init.d ]; then
|
|||||||
# Source the script so it inherits bashio functions from bashio-standalone.
|
# Source the script so it inherits bashio functions from bashio-standalone.
|
||||||
# Using bash "$script" would spawn a new process without bashio:: functions,
|
# Using bash "$script" would spawn a new process without bashio:: functions,
|
||||||
# causing "command not found" failures under set -e.
|
# causing "command not found" failures under set -e.
|
||||||
bash "$script"
|
# shellcheck disable=SC1090
|
||||||
|
source "$script"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user