superscreen: open a screen session with ssh connections to some servers
This commit is contained in:
parent
1bf173b97a
commit
7f7e5bec5a
1 changed files with 29 additions and 0 deletions
29
superscreen
Executable file
29
superscreen
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# superscreen: open a screen session with ssh connections to some servers
|
||||||
|
|
||||||
|
window=0
|
||||||
|
session="default"
|
||||||
|
servers="db dns ftp mail web"
|
||||||
|
|
||||||
|
# wipe dead screens
|
||||||
|
screen -wipe
|
||||||
|
|
||||||
|
if screen -list | grep -q "$session"
|
||||||
|
then
|
||||||
|
echo "Error: session \"$session\" already exists; please kill it first."
|
||||||
|
echo "type \"screen -X -S $session quit\" to do so."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
screen -d -m -S $session
|
||||||
|
screen -S $session -p $window -X exec printf "\033k%s\033\\" `hostname -s`
|
||||||
|
|
||||||
|
for server in $servers
|
||||||
|
do
|
||||||
|
let window++
|
||||||
|
screen -S $session -X screen ssh $server
|
||||||
|
screen -S $session -p $window -X exec printf "\033k%s\033\\" $server
|
||||||
|
done
|
||||||
|
|
||||||
|
screen -r $session -p 0
|
Loading…
Reference in a new issue