diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index fc71d25aa..c0363c7ad 100755 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -51,6 +51,7 @@ for KEYS in "${arr[@]}"; do if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi # For s6 if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi + if [ -f ~/.bashrc ]; then printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc; fi done diff --git a/.templates/90-config_yaml.sh b/.templates/90-config_yaml.sh index 28d80f84d..6b364d614 100755 --- a/.templates/90-config_yaml.sh +++ b/.templates/90-config_yaml.sh @@ -131,6 +131,7 @@ while IFS= read -r line; do sed -i "1a export $KEYS=\'$VALUE\'" /scripts/*run* 2>/dev/null || true # Export to s6 if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi + if [ -f ~/.bashrc ]; then printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc; fi # Show in log if ! bashio::config.false "verbose"; then bashio::log.blue "$KEYS=\'$VALUE\'"; fi else diff --git a/calibre/rootfs/etc/cont-init.d/00-data_location.sh b/calibre/rootfs/etc/cont-init.d/00-data_location.sh index 54163256b..262763b3d 100755 --- a/calibre/rootfs/etc/cont-init.d/00-data_location.sh +++ b/calibre/rootfs/etc/cont-init.d/00-data_location.sh @@ -48,6 +48,10 @@ if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME fi +if [ -f ~/.bashrc ]; then + printf "%s" "HOME=\"$LOCATION\"" >> ~/.bashrc + printf "%s" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc +fi usermod --home "$LOCATION" abc diff --git a/calibre/rootfs/etc/cont-init.d/80-configuration.sh b/calibre/rootfs/etc/cont-init.d/80-configuration.sh index d0c3bd94c..24413f3a8 100755 --- a/calibre/rootfs/etc/cont-init.d/80-configuration.sh +++ b/calibre/rootfs/etc/cont-init.d/80-configuration.sh @@ -15,6 +15,7 @@ if bashio::config.has_value 'KEYBOARD'; then bashio::log.info "Setting keyboard to $KEYBOARD" sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi + if [ -f ~/.bashrc ]; then printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc; fi fi || true # Set cli args @@ -24,6 +25,7 @@ if bashio::config.has_value 'CLI_ARGS'; then bashio::log.info "Setting arguments to $CLI_ARGS" sed -i "1a export CLI_ARGS=$CLI_ARGS" /etc/s6-overlay/s6-rc.d/svc-web/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$CLI_ARGS" > /var/run/s6/container_environment/CLI_ARGS; fi + if [ -f ~/.bashrc ]; then printf "%s" "CLI_ARGS=\"$CLI_ARGS\"" >> ~/.bashrc; fi fi || true # Set password @@ -33,4 +35,5 @@ if bashio::config.has_value 'PASSWORD'; then bashio::log.info "Setting password to $PASSWORD" sed -i "1a export PASSWORD=$PASSWORD" /etc/s6-overlay/s6-rc.d/svc-web/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$PASSWORD" > /var/run/s6/container_environment/PASSWORD; fi + if [ -f ~/.bashrc ]; then printf "%s" "PASSWORD=\"$PASSWORD\"" >> ~/.bashrc; fi fi || true diff --git a/calibre_web/rootfs/etc/cont-init.d/00-data_location.sh b/calibre_web/rootfs/etc/cont-init.d/00-data_location.sh index 67fe05f17..ec8ccc2df 100755 --- a/calibre_web/rootfs/etc/cont-init.d/00-data_location.sh +++ b/calibre_web/rootfs/etc/cont-init.d/00-data_location.sh @@ -38,6 +38,8 @@ sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/cont-init.d/* sed -i "s|/config/addons_config/calibre-web|$LOCATION|g" /etc/services.d/*/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi +if [ -f ~/.bashrc ]; then printf "%s" "HOME=\"$LOCATION\"" >> ~/.bashrc; fi +if [ -f ~/.bashrc ]; then printf "%s" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc; fi usermod --home "$LOCATION" abc diff --git a/immich/rootfs/etc/cont-init.d/20-folders.sh b/immich/rootfs/etc/cont-init.d/20-folders.sh index ff6be6d60..2b19378a5 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -14,6 +14,7 @@ export IMMICH_MEDIA_LOCATION="$DATA_LOCATION" if [ -d /var/run/s6/container_environment ]; then printf "%s" "$DATA_LOCATION" > /var/run/s6/container_environment/IMMICH_MEDIA_LOCATION fi +if [ -f ~/.bashrc ]; then printf "%s" "IMMICH_MEDIA_LOCATION=\"$DATA_LOCATION\"" >> ~/.bashrc; fi echo "... check $DATA_LOCATION folder exists" mkdir -p "$DATA_LOCATION" diff --git a/immich/rootfs/etc/cont-init.d/99-database.sh b/immich/rootfs/etc/cont-init.d/99-database.sh index e5c836e6e..c35f4a67f 100755 --- a/immich/rootfs/etc/cont-init.d/99-database.sh +++ b/immich/rootfs/etc/cont-init.d/99-database.sh @@ -82,3 +82,11 @@ if [ -d /var/run/s6/container_environment ]; then printf "%s" "$DB_HOSTNAME" > /var/run/s6/container_environment/DB_HOSTNAME printf "%s" "$JWT_SECRET" > /var/run/s6/container_environment/JWT_SECRET fi +if [ -f ~/.bashrc ]; then + printf "%s" "DB_USERNAME=\"$DB_USERNAME\"" >> ~/.bashrc + printf "%s" "DB_PASSWORD=\"$DB_PASSWORD\"" >> ~/.bashrc + printf "%s" "DB_DATABASE_NAME=\"$DB_DATABASE_NAME\"" >> ~/.bashrc + printf "%s" "DB_PORT=\"$DB_PORT\"" >> ~/.bashrc + printf "%s" "DB_HOSTNAME=\"$DB_HOSTNAME\"" >> ~/.bashrc + printf "%s" "JWT_SECRET=\"$JWT_SECRET\"" >> ~/.bashrc +fi diff --git a/photoprism/rootfs/etc/cont-init.d/99-run.sh b/photoprism/rootfs/etc/cont-init.d/99-run.sh index 2503526f9..5ea3f6038 100755 --- a/photoprism/rootfs/etc/cont-init.d/99-run.sh +++ b/photoprism/rootfs/etc/cont-init.d/99-run.sh @@ -35,21 +35,24 @@ case $(bashio::config 'DB_TYPE') in PHOTOPRISM_DATABASE_USER="$(bashio::services 'mysql' 'username')" PHOTOPRISM_DATABASE_PASSWORD="$(bashio::services 'mysql' 'password')" export PHOTOPRISM_DATABASE_DRIVER && \ - sed -i "1a PHOTOPRISM_DATABASE_DRIVER=$PHOTOPRISM_DATABASE_DRIVER" /scripts/entrypoint.sh && \ bashio::log.blue "PHOTOPRISM_DATABASE_DRIVER=$PHOTOPRISM_DATABASE_DRIVER" export PHOTOPRISM_DATABASE_SERVER && \ - sed -i "1a PHOTOPRISM_DATABASE_SERVER=$PHOTOPRISM_DATABASE_SERVER" /scripts/entrypoint.sh && \ bashio::log.blue "PHOTOPRISM_DATABASE_SERVER=$PHOTOPRISM_DATABASE_SERVER" export PHOTOPRISM_DATABASE_NAME && \ - sed -i "1a PHOTOPRISM_DATABASE_NAME=$PHOTOPRISM_DATABASE_NAME" /scripts/entrypoint.sh && \ bashio::log.blue "PHOTOPRISM_DATABASE_NAME=$PHOTOPRISM_DATABASE_NAME" export PHOTOPRISM_DATABASE_USER && \ - sed -i "1a PHOTOPRISM_DATABASE_USER=$PHOTOPRISM_DATABASE_USER" /scripts/entrypoint.sh && \ bashio::log.blue "PHOTOPRISM_DATABASE_USER=$PHOTOPRISM_DATABASE_USER" export PHOTOPRISM_DATABASE_PASSWORD && \ - sed -i "1a PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD" /scripts/entrypoint.sh && \ bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD" + if [ -f ~/.bashrc ]; then + printf "%s" "PHOTOPRISM_DATABASE_DRIVER=\"${PHOTOPRISM_DATABASE_DRIVER}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_DATABASE_SERVER=\"${PHOTOPRISM_DATABASE_SERVER}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_DATABASE_NAME=\"${PHOTOPRISM_DATABASE_NAME}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_DATABASE_USER=\"${PHOTOPRISM_DATABASE_USER}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_DATABASE_PASSWORD=\"${PHOTOPRISM_DATABASE_PASSWORD}\"" >> ~/.bashrc + fi + bashio::log.warning "Photoprism is using the Maria DB addon" bashio::log.warning "Please ensure this is included in your backups" bashio::log.warning "Uninstalling the MariaDB addon will remove any data" @@ -74,7 +77,7 @@ if bashio::config.true "ingress_disabled"; then else PHOTOPRISM_SITE_URL="$(bashio::addon.ingress_entry)/" export PHOTOPRISM_SITE_URL - sed -i "1a PHOTOPRISM_SITE_URL=$PHOTOPRISM_SITE_URL" /scripts/entrypoint.sh + if [ -f ~/.bashrc ]; then printf "%s" "PHOTOPRISM_SITE_URL=\"${PHOTOPRISM_SITE_URL}\"" >> ~/.bashrc; fi bashio::log.warning "Ingress is enabled. To connect, you must add $PHOTOPRISM_SITE_URL to the end of your access point. Example : http://my-url:8123$PHOTOPRISM_SITE_URL" fi @@ -93,11 +96,13 @@ export PHOTOPRISM_STORAGE_PATH export PHOTOPRISM_ORIGINALS_PATH export PHOTOPRISM_IMPORT_PATH export PHOTOPRISM_BACKUP_PATH -sed -i "1a PHOTOPRISM_UPLOAD_NSFW=$PHOTOPRISM_UPLOAD_NSFW" /scripts/entrypoint.sh -sed -i "1a PHOTOPRISM_STORAGE_PATH=$PHOTOPRISM_STORAGE_PATH" /scripts/entrypoint.sh -sed -i "1a PHOTOPRISM_ORIGINALS_PATH=$PHOTOPRISM_ORIGINALS_PATH" /scripts/entrypoint.sh -sed -i "1a PHOTOPRISM_IMPORT_PATH=$PHOTOPRISM_IMPORT_PATH" /scripts/entrypoint.sh -sed -i "1a PHOTOPRISM_BACKUP_PATH=$PHOTOPRISM_BACKUP_PATH" /scripts/entrypoint.sh +if [ -f ~/.bashrc ]; then + printf "%s" "PHOTOPRISM_UPLOAD_NSFW=\"${PHOTOPRISM_UPLOAD_NSFW}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_ORIGINALS_PATH=\"${PHOTOPRISM_ORIGINALS_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_BACKUP_PATH=\"${PHOTOPRISM_BACKUP_PATH}\"" >> ~/.bashrc +fi # Test configs for variabletest in $PHOTOPRISM_STORAGE_PATH $PHOTOPRISM_ORIGINALS_PATH $PHOTOPRISM_IMPORT_PATH $PHOTOPRISM_BACKUP_PATH; do @@ -121,6 +126,10 @@ if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then export PHOTOPRISM_GID="$PGID" sed -i "1a PHOTOPRISM_UID=$PHOTOPRISM_UID" /scripts/entrypoint.sh sed -i "1a PHOTOPRISM_GID=$PHOTOPRISM_GID" /scripts/entrypoint.sh + if [ -f ~/.bashrc ]; then + printf "%s" "PHOTOPRISM_UID=\"${PHOTOPRISM_UID}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_GID=\"${PHOTOPRISM_GID}\"" >> ~/.bashrc + fi fi # Start messages diff --git a/photoprism/rootfs/run.sh b/photoprism/rootfs/run.sh index 080411a5e..06a2a7200 100755 --- a/photoprism/rootfs/run.sh +++ b/photoprism/rootfs/run.sh @@ -26,6 +26,13 @@ export PHOTOPRISM_STORAGE_PATH=$(bashio::config 'STORAGE_PATH') export PHOTOPRISM_ORIGINALS_PATH=$(bashio::config 'ORIGINALS_PATH') export PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH') export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH') +if [ -f ~/.bashrc ]; then + printf "%s" "PHOTOPRISM_UPLOAD_NSFW=\"${PHOTOPRISM_UPLOAD_NSFW}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_ORIGINALS_PATH=\"${PHOTOPRISM_ORIGINALS_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" >> ~/.bashrc + printf "%s" "PHOTOPRISM_BACKUP_PATH=\"${PHOTOPRISM_BACKUP_PATH}\"" >> ~/.bashrc +fi if bashio::config.has_value 'CUSTOM_OPTIONS'; then CUSTOMOPTIONS=$(bashio::config 'CUSTOM_OPTIONS') diff --git a/qbittorrent/rootfs/etc/openvpn/down.sh b/qbittorrent/rootfs/etc/openvpn/down.sh index 2395b8e62..3c314f069 100755 --- a/qbittorrent/rootfs/etc/openvpn/down.sh +++ b/qbittorrent/rootfs/etc/openvpn/down.sh @@ -26,6 +26,7 @@ if [ -n "${RC_SVCNAME}" ]; then if /etc/init.d/"${RC_SVCNAME}" --quiet status ; then export IN_BACKGROUND=true if [ -d /var/run/s6/container_environment ]; then printf "%s" "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi + if [ -f ~/.bashrc ]; then printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc; fi /etc/init.d/"${RC_SVCNAME}" --quiet stop fi fi diff --git a/qbittorrent/rootfs/etc/openvpn/up.sh b/qbittorrent/rootfs/etc/openvpn/up.sh index 0636f0002..d1e82ce41 100755 --- a/qbittorrent/rootfs/etc/openvpn/up.sh +++ b/qbittorrent/rootfs/etc/openvpn/up.sh @@ -79,6 +79,7 @@ if [ -n "${RC_SVCNAME}" ]; then if ! /etc/init.d/"${RC_SVCNAME}" --quiet status ; then export IN_BACKGROUND=true if [ -d /var/run/s6/container_environment ]; then printf "%s" "true" > /var/run/s6/container_environment/IN_BACKGROUND; fi + if [ -f ~/.bashrc ]; then printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc; fi /etc/init.d/${RC_SVCNAME} --quiet start fi fi diff --git a/scrutiny/rootfs/etc/cont-init.d/90-run.sh b/scrutiny/rootfs/etc/cont-init.d/90-run.sh index 74ea95d69..5ff7242ca 100755 --- a/scrutiny/rootfs/etc/cont-init.d/90-run.sh +++ b/scrutiny/rootfs/etc/cont-init.d/90-run.sh @@ -41,6 +41,7 @@ if [[ "$(bashio::config "Mode")" == Collector ]]; then echo "export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" >> /env.sh sed -i "1a export COLLECTOR_API_ENDPOINT=$(bashio::config "COLLECTOR_API_ENDPOINT")" /etc/services.d/collector-once/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$COLLECTOR_API_ENDPOINT" > /var/run/s6/container_environment/COLLECTOR_API_ENDPOINT; fi + if [ -f ~/.bashrc ]; then printf "%s" "IN_BACKGROUND=\"$COLLECTOR_API_ENDPOINT\"" >> ~/.bashrc; fi bashio::log.info "Using 'COLLECTOR_API_ENDPOINT' $(bashio::config "COLLECTOR_API_ENDPOINT")" else bashio::exit.nok "Mode is set to 'Collector', but 'COLLECTOR_API_ENDPOINT' is not defined" diff --git a/transmission/rootfs/etc/cont-init.d/90-customUI.sh b/transmission/rootfs/etc/cont-init.d/90-customUI.sh index 365e76516..a31510b55 100755 --- a/transmission/rootfs/etc/cont-init.d/90-customUI.sh +++ b/transmission/rootfs/etc/cont-init.d/90-customUI.sh @@ -63,5 +63,6 @@ if bashio::config.has_value 'customUI' && [ ! "$CUSTOMUI" = default ] && [ ! "$C # Define variable if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export TRANSMISSION_WEB_HOME=$CUSTOMUI" /etc/services.d/*/*run* 2>/dev/null; fi if [ -d /var/run/s6/container_environment ]; then printf "%s" "$CUSTOMUI" > /var/run/s6/container_environment/TRANSMISSION_WEB_HOME; fi + if [ -f ~/.bashrc ]; then printf "%s" "TRANSMISSION_WEB_HOME=\"$CUSTOMUI\"" >> ~/.bashrc; fi fi diff --git a/webtop_kde/rootfs/etc/cont-init.d/00-data_location.sh b/webtop_kde/rootfs/etc/cont-init.d/00-data_location.sh index e052f4e43..ac6369dc3 100755 --- a/webtop_kde/rootfs/etc/cont-init.d/00-data_location.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/00-data_location.sh @@ -41,6 +41,8 @@ sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/services.d -type f) || true sed -i "s|/share/webtop_kde|$LOCATION|g" $(find /etc/s6-overlay/s6-rc.d -type f) || true if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi +if [ -f ~/.bashrc ]; then printf "%s" "HOME=\"$LOCATION\"" >> ~/.bashrc; fi +if [ -f ~/.bashrc ]; then printf "%s" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc; fi usermod --home "$LOCATION" abc diff --git a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh index a4831e4f2..8728c17f7 100755 --- a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh @@ -49,6 +49,7 @@ if bashio::config.has_value 'KEYBOARD'; then bashio::log.info "Setting keyboard to $KEYBOARD" sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi + if [ -f ~/.bashrc ]; then printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc; fi fi # Set password