From 2450b211e2eb0f518a7ed2899be4399ba16e22fb Mon Sep 17 00:00:00 2001 From: Keith Whyte Date: Wed, 6 Mar 2019 10:05:56 +0000 Subject: [PATCH] utils: local functions improvements --- modules/rhizo_base/templates/rccn-functions.sh.erb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/rhizo_base/templates/rccn-functions.sh.erb b/modules/rhizo_base/templates/rccn-functions.sh.erb index 85636e0..3c07b21 100644 --- a/modules/rhizo_base/templates/rccn-functions.sh.erb +++ b/modules/rhizo_base/templates/rccn-functions.sh.erb @@ -18,7 +18,7 @@ chans () { _output=`fs_cli -x 'show channels as delim |' | csvcut -d\| -c 3,2,6,8,10,11,13,15,18 | csvlook -I` clear echo "$_output" - sleep 0.5 + sleep 1 done } @@ -44,7 +44,7 @@ hlr() { } rk_ext() { - IMSI=$(curl -X GET http://10.23.0.3:8098/buckets/hlr/index/msisdn_bin/$1 2>/dev/null| sed -e 's/[^0-9]//g') + IMSI=$(curl -X GET http://10.23.0.3:8098/buckets/hlr/index/msisdn_bin/$1 2>/dev/null| python -c "import sys, json; print json.load(sys.stdin)['keys'][0]") echo $IMSI rk_imsi $IMSI } @@ -58,5 +58,13 @@ rk_imsi() { } tl() { - tail -f /var/log/rccn/*log + if [ "$1" == "" ] ; then + less -RS +F /var/log/rccn/*log + else + less -RS +F /var/log/rccn/$1.log + fi +} + +r() { + sudo -i bash -c "cd /var/rhizomatica/rccn; exec bash --login" }