Add warnings to modem scripts if the modem is not present
This commit is contained in:
parent
b4c02acb76
commit
fa3550c638
6 changed files with 25 additions and 6 deletions
scripts/modem
|
@ -1,6 +1,14 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
err() {
|
||||
echo -e "$1" | dmenu -fn Terminus-20 -c -l 10
|
||||
exit
|
||||
}
|
||||
|
||||
modem_n() {
|
||||
mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
|
||||
MODEMS="$(mmcli -L)"
|
||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is you're modem enabled?"
|
||||
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
|
||||
}
|
||||
|
||||
st -e sh -c "mmcli -m $(modem_n) && read"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue