2020-02-20 16:44:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-07-21 18:04:51 +00:00
|
|
|
log() {
|
|
|
|
echo "$@" | logger -t "postmarketOS:modem-setup"
|
|
|
|
}
|
|
|
|
|
|
|
|
QMBNCFG_CONFIG="1"
|
2020-02-21 13:47:07 +00:00
|
|
|
|
2021-08-26 07:34:46 +00:00
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
|
|
|
DEV="/dev/EG25.AT"
|
|
|
|
else
|
|
|
|
DEV="$1"
|
|
|
|
fi
|
|
|
|
|
2020-02-21 13:47:07 +00:00
|
|
|
# Read current config
|
2020-07-21 18:04:51 +00:00
|
|
|
QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -)
|
2020-02-21 13:47:07 +00:00
|
|
|
|
2020-11-10 09:57:54 +00:00
|
|
|
if echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG
|
2020-02-21 13:47:07 +00:00
|
|
|
then
|
2020-07-21 18:04:51 +00:00
|
|
|
log "Modem already configured"
|
2020-02-21 13:47:07 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-07-21 18:04:51 +00:00
|
|
|
|
|
|
|
# Configure VoLTE auto selecting profile
|
|
|
|
RET=$(echo "AT+QMBNCFG=\"AutoSel\",$QMBNCFG_CONFIG" | atinout - $DEV -)
|
|
|
|
if ! echo $RET | grep -q OK
|
|
|
|
then
|
|
|
|
log "Failed to enable VoLTE profile auto selecting: $RET"
|
|
|
|
exit 1
|
|
|
|
fi
|