13 lines
304 B
Bash
Executable file
13 lines
304 B
Bash
Executable file
#!/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]+'
|