~mil/sxmo-utils

ref: a3e4dc0fa47d4b73bf2c3d0f138e253abdbe982c sxmo-utils/scripts/modem/sxmo_modeminfo.sh -rwxr-xr-x 320 bytes
a3e4dc0fStacy Harper Make all sxmo menu SSH mode compatible 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env sh

err() {
	printf %b "$1" | dmenu -c -l 10
	exit
}

modem_n() {
	MODEMS="$(mmcli -L)"
	echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is your modem enabled?"
	echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}

st -e sh -c "mmcli -m $(modem_n) && read"