Add shell util functions
This commit is contained in:
parent
f3f4890704
commit
aa35d682e8
1 changed files with 24 additions and 0 deletions
|
@ -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
|
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 () {
|
ns () {
|
||||||
expect -c 'spawn -noecho telnet 0 4245; expect >; send enable\r; expect #; send "show ns\r"; expect #' | grep ALIVE;
|
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 () {
|
op () {
|
||||||
ps awxf | grep [o]smo\-
|
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 "#"';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue