fix environment file to not fill with duplicate values with restart container
Build and Push Docker Container / build-and-push (push) Successful in 58s

This commit is contained in:
2026-04-17 16:21:51 +02:00
parent 441d9a9890
commit 338ca43328
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
if [ ! -z $(cat /etc/environment | grep "USE_TMUX_SHELL") ] && [[ -t 0 ]] && [ -z "$TMUX" ]; then
if grep -q "USE_TMUX_SHELL" /etc/environment && [[ -t 0 ]] && [ -z "$TMUX" ]; then
tmux attach || tmux new-session
exit
fi
+2 -2
View File
@@ -9,12 +9,12 @@ USER_GROUP="$USER"
function set_environment_variables_if_not_empty {
# Set Tmux Shell for .bashrc to load tmux and attach session if exists else create new session
if [ -n "${USE_TMUX_SHELL:-}" ]; then
echo "USE_TMUX_SHELL=$USE_TMUX_SHELL" >> /etc/environment
grep -q "^USE_TMUX_SHELL=" /etc/environment || echo "USE_TMUX_SHELL=$USE_TMUX_SHELL" >> /etc/environment
fi
# Set Server Timezone
if [ -n "${TZ:-}" ]; then
echo "TZ=$TZ" >> /etc/environment
grep -q "^TZ=" /etc/environment || echo "TZ=$TZ" >> /etc/environment
ln -sf "/usr/share/zoneinfo/$TZ" /etc/localtime
fi
}