sh byobu默认窗口

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh byobu默认窗口相关的知识,希望对你有一定的参考价值。

#!/bin/bash
test -n SSH_AGENT || {
  eval $(ssh-agent -s)
  ssh-add
}

#create session
byobu-tmux new-session -dn $(hostname -f) "sudo -i"

# populate from salt-key
HOSTS=($(sudo salt-key -l acc  |grep -v 'Accepted'))
for H in ${HOSTS[@]}; do
  [[ "ctl dbs ntw kvm prx" =~ ${H/[0-9]*} ]] || continue
  byobu-tmux new-window -n ${H/.*/} "ssh -t $USER@$H 'sudo -i'"
done;

# attach
byobu-tmux attach
exit 0

# or by hand
byobu-tmux new-window -n ctl01 'ssh -t $USER@ctl01 "sudo -i"'
byobu-tmux new-window -n ctl02 'ssh -t $USER@ctl02 "sudo -i"'
byobu-tmux new-window -n ctl03 'ssh -t $USER@ctl03 "sudo -i"'
byobu-tmux new-window -n dbs01 'ssh -t $USER@dbs01 "sudo -i"'
byobu-tmux new-window -n dbs02 'ssh -t $USER@dbs02 "sudo -i"'
byobu-tmux new-window -n dbs03 'ssh -t $USER@dbs03 "sudo -i"'
byobu-tmux new-window -n ntw01 'ssh -t $USER@ntw01 "sudo -i"'
byobu-tmux new-window -n ntw02 'ssh -t $USER@ntw02 "sudo -i"'
byobu-tmux new-window -n ntw03 'ssh -t $USER@ntw03 "sudo -i"'
byobu-tmux new-window -n mon01 'ssh -t $USER@mon01 "sudo -i"'
byobu-tmux new-window -n prx01 'ssh -t $USER@prx01 "sudo -i"'
#byobu-tmux new-window -n log01 'ssh -t $USER@log01 "sudo -i"'
#byobu-tmux new-window -n mdb01 'ssh -t $USER@mdb01 "sudo -i"'
#byobu-tmux new-window -n mtr01 'ssh -t $USER@mtr01 "sudo -i"'
#byobu-tmux new-window -n bil01 'ssh -t $USER@bil01 "sudo -i"'
#byobu-tmux new-window -n nal01 'ssh -t $USER@nal01 "sudo -i"'
#byobu-tmux new-window -n nal02 'ssh -t $USER@nal02 "sudo -i"'
#byobu-tmux new-window -n nal03 'ssh -t $USER@nal03 "sudo -i"'
byobu-tmux attach

以上是关于sh byobu默认窗口的主要内容,如果未能解决你的问题,请参考以下文章

sh 将byobu安装到CentOS 7

sh 将byobu安装到CentOS 7

改用 screen 作为 byobu 的后端

如何在 ec2 ami 中安装 byobu

byobu copy

byobu 硬状态行在更新时滚动屏幕