diff --git a/modules/rhizo_base/templates/rccn-functions.sh.erb b/modules/rhizo_base/templates/rccn-functions.sh.erb index 424bbb0..58ff7f5 100644 --- a/modules/rhizo_base/templates/rccn-functions.sh.erb +++ b/modules/rhizo_base/templates/rccn-functions.sh.erb @@ -107,6 +107,10 @@ pdpc () { 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 | wc -l } +mmc () { + expect -c 'spawn -noecho telnet 0 4245; expect >; send enable\r; expect #; send "show mm-context all\r"; expect #' | grep IMEI | wc -l +} + ns () { expect -c 'spawn -noecho telnet 0 4245; expect >; send enable\r; expect #; send "show ns\r"; expect #' | grep ALIVE; } @@ -118,3 +122,23 @@ pp () { op () { ps awxf | grep [o]smo\- } + +lock () { + if [ "$1" == "" ] ; then + echo "BTS #?" + return + fi + expect -c 'set bts '$1'; spawn telnet localhost 4242; expect ">"; send "enable\r"; expect "#"; send "configure terminal\r"; expect "#"; + send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "trx 0\r"; expect "#"; send "rf_locked 1\r"; + expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"'; +} + +unlock () { + if [ "$1" == "" ] ; then + echo "BTS #?" + return + fi + expect -c 'set bts '$1'; spawn telnet localhost 4242; expect ">"; send "enable\r"; expect "#"; send "configure terminal\r"; expect "#"; + send "network\r"; expect "#"; send "bts $bts\r"; expect "#"; send "trx 0\r"; expect "#"; send "rf_locked 0\r"; + expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"; send "exit\r"; expect "#"'; +}