pmaports/device/main/device-pine64-pinephone/setup-modem.sh
Arnavion bb25d9aa61
pine64-pinephone: fix pinephone_modem-setup to correctly invoke atinout (MR 2462)
`$DEV` was an undefined variable so the atinout commands were printing their
helptext instead of actually running. This was noticeable because
the "Failed to enable VoLTE profile auto selecting" log was being printed
along with said helptext to syslog.

The block that defined `$DEV` had been accidentally deleted in
bb41f53879 . This change restores it.
2021-08-26 00:34:46 -07:00

32 lines
569 B
Bash

#!/bin/sh
log() {
echo "$@" | logger -t "postmarketOS:modem-setup"
}
QMBNCFG_CONFIG="1"
if [ -z "$1" ]
then
DEV="/dev/EG25.AT"
else
DEV="$1"
fi
# Read current config
QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -)
if echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG
then
log "Modem already configured"
exit 0
fi
# 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