Add shell vty helper

Yet another vty helper that opens vtys in tmux - this one
is more related to PS service.
This commit is contained in:
Keith Whyte 2023-07-18 23:32:53 +02:00
parent 20c16d811a
commit 983453313d

View file

@ -121,6 +121,43 @@ vt ()
tmux attach -t vtys ;
}
vtps ()
{
tmux has-session -t vty_ps 2> /dev/null;
if [ $? -eq 0 ]; then
tmux a -t vty_ps
return;
fi;
tmux start-server;
tmux new -s vty_ps -d -n VTY;
for vty in msc sg hlr;
do
if [ "$vty" == "msc" ]; then
pane=0;
fi;
if [ "$vty" == "hlr" ]; then
pane=2;
fi;
if [ "$vty" == "sg" -o "$vty" == "hlr" ]; then
split=h;
else
split=v;
fi;
tmux split-window -t $pane -$split "vty $vty $*";
done;
tmux select-pane -t:.0;
tmux send "b0 /usr/local/bin/pcu" C-m
tmux select-pane -t:.1;
tmux send "show mm-context all" C-m
tmux select-pane -t:.2;
tmux send "show subscriber cache" C-m
tmux select-pane -t:.3;
tmux send "show subscribers last-seen" C-m
tmux select-pane -t:.0;
tmux send "show ms all" C-m
tmux attach -t vty_ps
}
bA() {
source /home/rhizomatica/bin/vars.sh
tmux has-session -t bts 2>/dev/null