Add shell function: ssh to all BTS in tmux
This commit is contained in:
parent
ee6e0393a1
commit
b2351d2679
1 changed files with 21 additions and 0 deletions
|
@ -98,6 +98,27 @@ b<%= index %>() {
|
||||||
}
|
}
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
bA() {
|
||||||
|
tmux start-server
|
||||||
|
tmux new -s bts -d -n BTS0 "source /etc/profile.d/rccn-functions.sh ; b0"
|
||||||
|
# This won't look great for more than 4 windows, but
|
||||||
|
# that is not a lot of space anyway.
|
||||||
|
pane=0
|
||||||
|
for bts in "${!BTS[@]}" ; do
|
||||||
|
if [ $bts == 0 ] ; then continue; fi
|
||||||
|
if [ $bts == 3 ] ; then
|
||||||
|
pane=2;
|
||||||
|
fi
|
||||||
|
if [ $bts -lt 2 ] ; then
|
||||||
|
split=h
|
||||||
|
else
|
||||||
|
split=v
|
||||||
|
fi
|
||||||
|
tmux split-window -t $pane -$split "source /etc/profile.d/rccn-functions.sh ; b$bts"
|
||||||
|
done
|
||||||
|
tmux attach -t bts
|
||||||
|
}
|
||||||
|
|
||||||
pdp () {
|
pdp () {
|
||||||
expect -c 'spawn -noecho telnet 0 4245; expect >; send enable\r; expect #; send "show pdp-context all\r"; expect #' | grep "PDP Address" | grep -v invalid | sort -t. -n -k3,3n -k4,4n;
|
expect -c 'spawn -noecho telnet 0 4245; expect >; send enable\r; expect #; send "show pdp-context all\r"; expect #' | grep "PDP Address" | grep -v invalid | sort -t. -n -k3,3n -k4,4n;
|
||||||
echo Count: $(pdpc)
|
echo Count: $(pdpc)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue