mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-12 02:21:28 +02:00
Export variable to bashrc
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user