Login MOTD will now display in first shell of a new session

by printing /var/run/motd.dynamic to terminal befor running ZSH
This commit is contained in:
BuildTools
2021-03-18 04:04:32 +00:00
parent a8ace02283
commit 3c64e4d1d0
2 changed files with 2 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" = "" ]; then if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" = "" ]; then
tmux has-session -t $(tty | sed 's/^.....//') 2>/dev/null tmux has-session -t $(tty | sed 's/^.....//') 2>/dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
exec tmux new-session -s $(tty | sed 's/^.....//') exec tmux new-session -s $(tty | sed 's/^.....//') "cat /var/run/motd.dynamic;zsh"
else else
exec tmux attach-session -t $(tty | sed 's/^.....//') exec tmux attach-session -t $(tty | sed 's/^.....//')
fi fi

View File

@@ -1,7 +1,7 @@
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
tmux has-session -t remote 2>/dev/null tmux has-session -t remote 2>/dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
exec tmux new-session -s remote exec tmux new-session -s remote "cat /var/run/motd.dynamic;zsh"
else else
exec tmux attach-session -t remote exec tmux attach-session -t remote
fi fi