mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 05:14:04 +02:00
Improve bashio replacement
This commit is contained in:
@@ -16,7 +16,7 @@ if ! bashio::supervisor.ping 2>/dev/null; then
|
|||||||
'-----------------------------------------------------------'
|
'-----------------------------------------------------------'
|
||||||
# Use environment variables instead of addon options
|
# Use environment variables instead of addon options
|
||||||
echo "... convert scripts to use environment variables instead of addon options"
|
echo "... convert scripts to use environment variables instead of addon options"
|
||||||
for scripts in /etc/cont-init.d/*; do
|
for scripts in $(grep -srl "bashio" /etc/cont-init.d /etc/s6-overlay/s6-rc.d /custom-services.d); do
|
||||||
sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ]/g' \
|
sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ]/g' \
|
||||||
-e 's/bashio::config.true[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ] \&\& [ "${\1:-}" = "true" ]/g' \
|
-e 's/bashio::config.true[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ] \&\& [ "${\1:-}" = "true" ]/g' \
|
||||||
-e 's/\$(bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"'])/${\1:-}/g' \
|
-e 's/\$(bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"'])/${\1:-}/g' \
|
||||||
|
|||||||
Reference in New Issue
Block a user