I was having an issue with USA T-Mobile (not CDMA) on the PureOS port for PP CE in which T-Mobile spam sent MMS messages to me (perhaps trying to confirm something). This was further exacerbated by being in an area without signal and the phone's battery dying regularly. I created the following script to delete the messages they send.
While I haven't put this in a cron, the script works and should be able to be placed in a cron.
Code:
#!/bin/bash
MODEM=`sudo mmcli -L | awk '{print $1}' | awk -F'/' '{print $6}'`
oIFS=$IFS
IFS=$'\n'
CACHEDSMS=""
for CACHEDSMS in `sudo mmcli -m $MODEM --messaging-list-sms | awk '{print $1}' | awk -F'/' '{print $6}'`; do
if sudo mmcli -s $CACHEDSMS | grep 'smsc: +12063130057' ; then
sudo mmcli -m $MODEM --messaging-delete-sms=$CACHEDSMS
fi
done
While I haven't put this in a cron, the script works and should be able to be placed in a cron.