wpj428/files/usr/sbin/get_lcid

14 lines
304 B
Text
Raw Normal View History

2021-03-23 12:38:36 +00:00
#!/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]+'