Files
zpower/files/tmux-local.zsh
BuildTools 3c64e4d1d0 Login MOTD will now display in first shell of a new session
by printing /var/run/motd.dynamic to terminal befor running ZSH
2021-03-18 04:04:32 +00:00

9 lines
313 B
Bash

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