Add shell function: ssh to all BTS in tmux

This commit is contained in:
Keith Whyte 2021-05-28 02:21:37 +02:00
parent ee6e0393a1
commit b2351d2679

View file

@ -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)