diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index c0363c7ad..9cc746070 100755 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -51,7 +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 + printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc done diff --git a/.templates/90-config_yaml.sh b/.templates/90-config_yaml.sh index 6b364d614..cb11faef9 100755 --- a/.templates/90-config_yaml.sh +++ b/.templates/90-config_yaml.sh @@ -131,7 +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 + printf "%s" "${KEYS}=\"${VALUE}\"" >> ~/.bashrc # 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 e7b2f16d0..18caa6ee8 100755 --- a/calibre/rootfs/etc/cont-init.d/00-data_location.sh +++ b/calibre/rootfs/etc/cont-init.d/00-data_location.sh @@ -48,12 +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\"" 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 24413f3a8..9fe827567 100755 --- a/calibre/rootfs/etc/cont-init.d/80-configuration.sh +++ b/calibre/rootfs/etc/cont-init.d/80-configuration.sh @@ -15,7 +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 + printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc fi || true # Set cli args @@ -25,7 +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 + printf "%s" "CLI_ARGS=\"$CLI_ARGS\"" >> ~/.bashrc fi || true # Set password @@ -35,5 +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 + printf "%s" "PASSWORD=\"$PASSWORD\"" >> ~/.bashrc 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 ec8ccc2df..2c35b16c7 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,8 +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 +printf "%s" "HOME=\"$LOCATION\"" >> ~/.bashrc +printf "%s" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc 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 2b19378a5..94eabf2fa 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -14,7 +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 +printf "%s" "IMMICH_MEDIA_LOCATION=\"$DATA_LOCATION\"" >> ~/.bashrc 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 347f09eaa..d8fc8fccb 100755 --- a/immich/rootfs/etc/cont-init.d/99-database.sh +++ b/immich/rootfs/etc/cont-init.d/99-database.sh @@ -82,7 +82,7 @@ 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\"" printf "%s" "DB_PASSWORD=\"$DB_PASSWORD\"" @@ -91,4 +91,3 @@ if [ -f ~/.bashrc ]; then printf "%s" "DB_HOSTNAME=\"$DB_HOSTNAME\"" 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 6dd175b65..8475ef6e8 100755 --- a/photoprism/rootfs/etc/cont-init.d/99-run.sh +++ b/photoprism/rootfs/etc/cont-init.d/99-run.sh @@ -45,7 +45,6 @@ case $(bashio::config 'DB_TYPE') in export PHOTOPRISM_DATABASE_PASSWORD && \ bashio::log.blue "PHOTOPRISM_DATABASE_PASSWORD=$PHOTOPRISM_DATABASE_PASSWORD" - if [ -f ~/.bashrc ]; then { printf "%s" "PHOTOPRISM_DATABASE_DRIVER=\"${PHOTOPRISM_DATABASE_DRIVER}\"" printf "%s" "PHOTOPRISM_DATABASE_SERVER=\"${PHOTOPRISM_DATABASE_SERVER}\"" @@ -53,7 +52,6 @@ case $(bashio::config 'DB_TYPE') in printf "%s" "PHOTOPRISM_DATABASE_USER=\"${PHOTOPRISM_DATABASE_USER}\"" 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" @@ -79,7 +77,7 @@ if bashio::config.true "ingress_disabled"; then else PHOTOPRISM_SITE_URL="$(bashio::addon.ingress_entry)/" export PHOTOPRISM_SITE_URL - if [ -f ~/.bashrc ]; then printf "%s" "PHOTOPRISM_SITE_URL=\"${PHOTOPRISM_SITE_URL}\"" >> ~/.bashrc; fi + printf "%s" "PHOTOPRISM_SITE_URL=\"${PHOTOPRISM_SITE_URL}\"" >> ~/.bashrc 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 @@ -98,7 +96,7 @@ export PHOTOPRISM_STORAGE_PATH export PHOTOPRISM_ORIGINALS_PATH export PHOTOPRISM_IMPORT_PATH export PHOTOPRISM_BACKUP_PATH -if [ -f ~/.bashrc ]; then + { printf "%s" "PHOTOPRISM_UPLOAD_NSFW=\"${PHOTOPRISM_UPLOAD_NSFW}\"" printf "%s" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" @@ -106,7 +104,6 @@ if [ -f ~/.bashrc ]; then printf "%s" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" 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 @@ -130,12 +127,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}\"" printf "%s" "PHOTOPRISM_GID=\"${PHOTOPRISM_GID}\"" } >> ~/.bashrc - fi fi # Start messages diff --git a/photoprism/rootfs/run.sh b/photoprism/rootfs/run.sh index 89bb8cde3..55a9d5f39 100755 --- a/photoprism/rootfs/run.sh +++ b/photoprism/rootfs/run.sh @@ -26,7 +26,7 @@ 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}\"" printf "%s" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" @@ -34,7 +34,6 @@ if [ -f ~/.bashrc ]; then printf "%s" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" 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 3c314f069..8f31dd6b5 100755 --- a/qbittorrent/rootfs/etc/openvpn/down.sh +++ b/qbittorrent/rootfs/etc/openvpn/down.sh @@ -26,7 +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 + printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc /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 d1e82ce41..33a8b877a 100755 --- a/qbittorrent/rootfs/etc/openvpn/up.sh +++ b/qbittorrent/rootfs/etc/openvpn/up.sh @@ -79,7 +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 + printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc /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 5ff7242ca..8fc4bd440 100755 --- a/scrutiny/rootfs/etc/cont-init.d/90-run.sh +++ b/scrutiny/rootfs/etc/cont-init.d/90-run.sh @@ -41,7 +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 + printf "%s" "IN_BACKGROUND=\"$COLLECTOR_API_ENDPOINT\"" >> ~/.bashrc 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 a31510b55..c9536ff0d 100755 --- a/transmission/rootfs/etc/cont-init.d/90-customUI.sh +++ b/transmission/rootfs/etc/cont-init.d/90-customUI.sh @@ -63,6 +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 + printf "%s" "TRANSMISSION_WEB_HOME=\"$CUSTOMUI\"" >> ~/.bashrc 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 ac6369dc3..7ef5c0770 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,8 +41,10 @@ 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 +{ +printf "%s" "HOME=\"$LOCATION\"" +printf "%s" "FM_HOME=\"$LOCATION\"" +} >> ~/.bashrc 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 8728c17f7..592817b44 100755 --- a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh @@ -49,7 +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 + printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc fi # Set password