Add warnings to modem scripts if the modem is not present

This commit is contained in:
Miles Alan 2020-05-20 16:52:00 -05:00
parent b4c02acb76
commit fa3550c638
6 changed files with 25 additions and 6 deletions

View file

@ -12,7 +12,7 @@ touch $UPDATEFILE
while :
do
# M symbol if modem monitoring is on
# M symbol if modem monitoring is on & modem present
MODEMMON=""
pgrep -f sxmo_modemmonitor.sh && MODEMMON="M "

View file

@ -7,7 +7,6 @@ xmodmap /usr/share/sxmo/xmodmap_caps_esc
xsetroot -mod 3 2 -fg '#000000' -bg '#888888'
xset s off -dpms
alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
sxmo_modemmonitor.sh &
#xset r off
# E.g. for PBP

View file

@ -10,7 +10,9 @@ err() {
}
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
}
contacts() {

View file

@ -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"

View file

@ -2,9 +2,17 @@
TIMEOUT=3
LOGDIR=/home/$USER/.sxmo
ACTIVECALL="NONE"
trap "kill 0" SIGINT
err() {
echo -e "$1" | dmenu -fn Terminus-20 -c -l 10
kill -9 0
}
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?\nDisabling modem monitor"
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}
newcall() {

View file

@ -8,7 +8,9 @@ err() {
}
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
}
textcontacts() {