mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Update 99-run.sh
This commit is contained in:
@@ -87,17 +87,20 @@ for variable in PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DI
|
|||||||
variablecontent="$(eval echo "\$$variable")"
|
variablecontent="$(eval echo "\$$variable")"
|
||||||
# Sanitize " ' ` in current variable
|
# Sanitize " ' ` in current variable
|
||||||
variablecontent="${variablecontent//[\"\'\`]/}"
|
variablecontent="${variablecontent//[\"\'\`]/}"
|
||||||
bashio::log.blue "$variable=\"$variablecontent\""
|
if [[ $variablecontent = *" "* ]]; then
|
||||||
|
variablecontent="'$variablecontent'"
|
||||||
|
fi
|
||||||
|
bashio::log.blue "$variable=$variablecontent"
|
||||||
|
|
||||||
# Export
|
# Export
|
||||||
export "$variable=\"$variablecontent\""
|
export "$variable=$variablecontent"
|
||||||
# Add to bashrc
|
# Add to bashrc
|
||||||
eval echo "$variable=\"$variablecontent\"" >> ~/.bashrc
|
eval echo "$variable=$variablecontent" >> ~/.bashrc
|
||||||
# set .env
|
# set .env
|
||||||
echo "$variable=\"$variablecontent\"" >> /.env || true
|
echo "$variable=$variablecontent" >> /.env || true
|
||||||
# set /etc/environment
|
# set /etc/environment
|
||||||
mkdir -p /etc
|
mkdir -p /etc
|
||||||
echo "$variable=\"$variablecontent\"" >> /etc/environment
|
echo "$variable=$variablecontent" >> /etc/environment
|
||||||
# For s6
|
# For s6
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${variablecontent}" > /var/run/s6/container_environment/"${variable}"; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${variablecontent}" > /var/run/s6/container_environment/"${variable}"; fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user