14 lines
304 B
Text
14 lines
304 B
Text
|
#!/bin/sh
|
||
|
rm -f /tmp/logread.txt
|
||
|
|
||
|
logread -f > /tmp/logread.txt &
|
||
|
LOGREAD_PID=$!
|
||
|
|
||
|
mmcli -m 0 --command="AT+CREG?" > /dev/null
|
||
|
kill -9 ${LOGREAD_PID}
|
||
|
|
||
|
ATRES=$(grep -Eo '\+CREG: [0-9],[0-9],"[0-9A-F]+","[0-9A-F]+"' /tmp/logread.txt)
|
||
|
rm -f /tmp/logread.txt
|
||
|
|
||
|
echo $ATRES | cut -d, -f4 | grep -Eo '[0-9A-F]+'
|