mobian-scripts/mms-check

22 lines
393 B
Plaintext
Raw Normal View History

2021-01-20 03:39:03 +00:00
#!/usr/bin/perl
use 5.12.0;
use strict;
use warnings;
# Find modem ID
my $modem;
my $list = `mmcli -L`;
if ($list =~ m{/Modem/(\d+)}i) {
$modem = $1;
} else {
die "didn't find modem id";
}
my $chk = `mmcli -m $modem --messaging-list-sms`;
my @lines = split(/\n/, $chk);
if ($chk !~ /no sms messages were found/i) {
say "Notice: mmcli shows there are pending SMS messages:";
say $chk;
}