shell utility functions: add, improve
Add a function to open 4 common osmo vtys and make sure these tmux functions don't open new sessions if the session already exists
This commit is contained in:
parent
ab946b6e10
commit
90e9e7032a
1 changed files with 38 additions and 0 deletions
|
@ -79,6 +79,11 @@ o() {
|
||||||
}
|
}
|
||||||
|
|
||||||
f() {
|
f() {
|
||||||
|
tmux has-session -t SIP 2>/dev/null
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
tmux a -t SIP
|
||||||
|
return
|
||||||
|
fi
|
||||||
tmux new-session -n SIP "sudo sngrep -d any" \; splitw -p 60 "fs_cli -r" \; select-window -t SIP \;
|
tmux new-session -n SIP "sudo sngrep -d any" \; splitw -p 60 "fs_cli -r" \; select-window -t SIP \;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +115,41 @@ b<%= index %>() {
|
||||||
}
|
}
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
vt ()
|
||||||
|
{
|
||||||
|
tmux has-session -t vtys 2>/dev/null
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
tmux a -t vtys
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
tmux start-server;
|
||||||
|
tmux new -s vtys -d -n VTY "vty bsc $*";
|
||||||
|
for vty in msc mgw hlr;
|
||||||
|
do
|
||||||
|
if [ "$vty" == "msc" ]; then
|
||||||
|
pane=0;
|
||||||
|
fi;
|
||||||
|
if [ "$vty" == "hlr" ]; then
|
||||||
|
pane=2;
|
||||||
|
fi;
|
||||||
|
if [ "$vty" == "mgw" -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 attach -t vtys ;
|
||||||
|
}
|
||||||
|
|
||||||
bA() {
|
bA() {
|
||||||
source /home/rhizomatica/bin/vars.sh
|
source /home/rhizomatica/bin/vars.sh
|
||||||
|
tmux has-session -t bts 2>/dev/null
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
tmux a -t bts
|
||||||
|
return
|
||||||
|
fi
|
||||||
tmux start-server
|
tmux start-server
|
||||||
tmux new -s bts -d -n BTS0 "source /etc/profile.d/rccn-functions.sh ; b0 $*"
|
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
|
# This won't look great for more than 4 windows, but
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue