Adding shell functions to change/get network policy with nitb

This commit is contained in:
infercom2 2021-09-23 00:38:30 -05:00 committed by Keith Whyte
parent f0caa13e62
commit 40860f04e2

View file

@ -193,3 +193,16 @@ smsq-max()
expect -c 'set queue '$1'; set port <% if @osmo_stack != "split" -%>4242<% else -%>4254<% end -%>; spawn telnet localhost $port; expect ">"; send "enable\r"; expect "#"; send "sms-queue max-pending $queue\r"; expect "#";
send "sms-queue trigger\r"; expect "#";'
}
<% if @osmo_stack != "split" %>
close-net () {
expect -c 'spawn -noecho telnet 0 4242; expect >; send enable\r; expect #; send "configure terminal\r"; expect #; send network\r; expect #; send "auth policy closed\r"; expect #; send \r' ; echo -e " \r Closed Network"
}
open-net () {
expect -c 'spawn -noecho telnet 0 4242; expect >; send enable\r; expect #; send "configure terminal\r"; expect #; send network\r; expect #; send "auth policy accept-all \r";expect #; send \r' ; echo -e " \r Opened Network"
}
p-net (){
echo "show network" | nc -q1 localhost 4242 | grep "policy" | awk -F "," '{print $1 }'
}
<% end %>