mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Create ~/.bashrc https://github.com/alexbelgium/hassio-addons/issues/798
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user