Files
zpower/files/tmux-ssh.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

14 lines
376 B
Bash

if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
tmux has-session -t remote 2>/dev/null
if [ $? != 0 ]; then
exec tmux new-session -s remote "cat /var/run/motd.dynamic;zsh"
else
exec tmux attach-session -t remote
fi
fi
if [ "$SSH_CONNECTION" != "" ]; then
tmux source-file $HOME/.tmux.conf.ssh
else
tmux source-file $HOME/.tmux.conf
fi