From b42ad692ae541f4a79a4e47e1df242c85117a510 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:23:20 +0200 Subject: [PATCH] Add line breaks in bashrc https://github.com/alexbelgium/hassio-addons/issues/1557 --- calibre/rootfs/etc/cont-init.d/20-folders.sh | 4 ++-- calibre/rootfs/etc/cont-init.d/80-configuration.sh | 4 ++-- .../rootfs/etc/cont-init.d/00-data_location.sh | 4 ++-- immich/rootfs/etc/cont-init.d/20-folders.sh | 2 +- immich/rootfs/etc/cont-init.d/99-run.sh | 12 ++++++------ photoprism/rootfs/run.sh | 10 +++++----- qbittorrent/rootfs/etc/openvpn/down.sh | 2 +- qbittorrent/rootfs/etc/openvpn/up.sh | 2 +- scrutiny/rootfs/etc/cont-init.d/90-run.sh | 2 +- transmission/rootfs/etc/cont-init.d/90-customUI.sh | 2 +- .../rootfs/etc/cont-init.d/80-configuration.sh | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/calibre/rootfs/etc/cont-init.d/20-folders.sh b/calibre/rootfs/etc/cont-init.d/20-folders.sh index a381ad829..7df5f0617 100755 --- a/calibre/rootfs/etc/cont-init.d/20-folders.sh +++ b/calibre/rootfs/etc/cont-init.d/20-folders.sh @@ -56,8 +56,8 @@ usermod --home "$LOCATION" abc 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 { - printf "%s" "HOME=\"$LOCATION\"" - printf "%s" "FM_HOME=\"$LOCATION\"" + printf "%s\n" "HOME=\"$LOCATION\"" + printf "%s\n" "FM_HOME=\"$LOCATION\"" } >> ~/.bashrc # Create folder diff --git a/calibre/rootfs/etc/cont-init.d/80-configuration.sh b/calibre/rootfs/etc/cont-init.d/80-configuration.sh index d4ae3b2eb..2affd9e3f 100755 --- a/calibre/rootfs/etc/cont-init.d/80-configuration.sh +++ b/calibre/rootfs/etc/cont-init.d/80-configuration.sh @@ -34,7 +34,7 @@ if bashio::config.has_value 'CLI_ARGS'; then CLI_ARGS=$(bashio::config 'CLI_ARGS') bashio::log.info "Setting arguments to $CLI_ARGS" if [ -d /var/run/s6/container_environment ]; then printf "%s" "$CLI_ARGS" >/var/run/s6/container_environment/CLI_ARGS; fi - printf "%s" "CLI_ARGS=\"$CLI_ARGS\"" >>~/.bashrc + printf "%s\n" "CLI_ARGS=\"$CLI_ARGS\"" >>~/.bashrc fi || true # Set keyboard @@ -42,7 +42,7 @@ if bashio::config.has_value 'KEYBOARD'; then KEYBOARD=$(bashio::config 'KEYBOARD') bashio::log.info "Setting keyboard to $KEYBOARD" if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" >/var/run/s6/container_environment/KEYBOARD; fi - printf "%s" "KEYBOARD=\"$KEYBOARD\"" >>~/.bashrc + printf "%s\n" "KEYBOARD=\"$KEYBOARD\"" >>~/.bashrc fi || true # Set password 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 12fc9d7f9..991ff94b3 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 @@ -39,8 +39,8 @@ sed -i "s|/config|$LOCATION|g" /etc/cont-init.d/* sed -i "s|/config|$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 -printf "%s" "HOME=\"$LOCATION\"" >> ~/.bashrc -printf "%s" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc +printf "%s\n" "HOME=\"$LOCATION\"" >> ~/.bashrc +printf "%s\n" "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 a246bdf77..0d6232fb6 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -24,7 +24,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 -printf "%s" "IMMICH_MEDIA_LOCATION=\"$DATA_LOCATION\"" >> ~/.bashrc +printf "%s\n" "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-run.sh b/immich/rootfs/etc/cont-init.d/99-run.sh index bc098f879..d80687bfd 100755 --- a/immich/rootfs/etc/cont-init.d/99-run.sh +++ b/immich/rootfs/etc/cont-init.d/99-run.sh @@ -83,12 +83,12 @@ if [ -d /var/run/s6/container_environment ]; then fi { - printf "%s" "DB_USERNAME=\"$DB_USERNAME\"" - printf "%s" "DB_PASSWORD=\"$DB_PASSWORD\"" - printf "%s" "DB_DATABASE_NAME=\"$DB_DATABASE_NAME\"" - printf "%s" "DB_PORT=\"$DB_PORT\"" - printf "%s" "DB_HOSTNAME=\"$DB_HOSTNAME\"" - printf "%s" "JWT_SECRET=\"$JWT_SECRET\"" + printf "%s\n" "DB_USERNAME=\"$DB_USERNAME\"" + printf "%s\n" "DB_PASSWORD=\"$DB_PASSWORD\"" + printf "%s\n" "DB_DATABASE_NAME=\"$DB_DATABASE_NAME\"" + printf "%s\n" "DB_PORT=\"$DB_PORT\"" + printf "%s\n" "DB_HOSTNAME=\"$DB_HOSTNAME\"" + printf "%s\n"n" "JWT_SECRET=\"$JWT_SECRET\"" } >> ~/.bashrc ################### diff --git a/photoprism/rootfs/run.sh b/photoprism/rootfs/run.sh index 5441c9158..873dad333 100755 --- a/photoprism/rootfs/run.sh +++ b/photoprism/rootfs/run.sh @@ -29,11 +29,11 @@ export PHOTOPRISM_IMPORT_PATH=$(bashio::config 'IMPORT_PATH') export PHOTOPRISM_BACKUP_PATH=$(bashio::config 'BACKUP_PATH') { - printf "%s" "PHOTOPRISM_UPLOAD_NSFW=\"${PHOTOPRISM_UPLOAD_NSFW}\"" - printf "%s" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" - printf "%s" "PHOTOPRISM_ORIGINALS_PATH=\"${PHOTOPRISM_ORIGINALS_PATH}\"" - printf "%s" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" - printf "%s" "PHOTOPRISM_BACKUP_PATH=\"${PHOTOPRISM_BACKUP_PATH}\"" + printf "%s\n" "PHOTOPRISM_UPLOAD_NSFW=\"${PHOTOPRISM_UPLOAD_NSFW}\"" + printf "%s\n" "PHOTOPRISM_STORAGE_PATH=\"${PHOTOPRISM_STORAGE_PATH}\"" + printf "%s\n" "PHOTOPRISM_ORIGINALS_PATH=\"${PHOTOPRISM_ORIGINALS_PATH}\"" + printf "%s\n" "PHOTOPRISM_IMPORT_PATH=\"${PHOTOPRISM_IMPORT_PATH}\"" + printf "%s\n" "PHOTOPRISM_BACKUP_PATH=\"${PHOTOPRISM_BACKUP_PATH}\"" } >> ~/.bashrc if bashio::config.has_value 'CUSTOM_OPTIONS'; then diff --git a/qbittorrent/rootfs/etc/openvpn/down.sh b/qbittorrent/rootfs/etc/openvpn/down.sh index 8f31dd6b5..0355af840 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 - printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc + printf "%s\n" "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 33a8b877a..dc7c55394 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 - printf "%s" "IN_BACKGROUND=\"true\"" >> ~/.bashrc + printf "%s\n" "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 d00d912ec..d6116eb2b 100755 --- a/scrutiny/rootfs/etc/cont-init.d/90-run.sh +++ b/scrutiny/rootfs/etc/cont-init.d/90-run.sh @@ -42,7 +42,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 - printf "%s" "IN_BACKGROUND=\"$COLLECTOR_API_ENDPOINT\"" >> ~/.bashrc + printf "%s\n" "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 909785c3d..ad8077596 100755 --- a/transmission/rootfs/etc/cont-init.d/90-customUI.sh +++ b/transmission/rootfs/etc/cont-init.d/90-customUI.sh @@ -64,6 +64,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 - printf "%s" "TRANSMISSION_WEB_HOME=\"$CUSTOMUI\"" >> ~/.bashrc + printf "%s\n" "TRANSMISSION_WEB_HOME=\"$CUSTOMUI\"" >> ~/.bashrc fi 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 a84504ce8..1b7989705 100755 --- a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh @@ -33,7 +33,7 @@ if bashio::config.has_value 'KEYBOARD'; then KEYBOARD=$(bashio::config 'KEYBOARD') bashio::log.info "Setting keyboard to $KEYBOARD" if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi - printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc + printf "%s\n" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc fi || true # Set password