Export variable to bashrc

This commit is contained in:
Alexandre
2023-04-24 12:18:38 +02:00
parent 1545c8f6c6
commit a76d60808b
15 changed files with 54 additions and 11 deletions

View File

@@ -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

View File

@@ -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