From e11d3aaea31d9b99157fea7a330b4301195baf06 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sat, 31 Oct 2020 22:37:21 +0100 Subject: [PATCH] some minor cleanup of issues detected by shellcheck after applying the patch: 'modemmonitor: use dbus-monitor' --- scripts/modem/sxmo_modemmonitor.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index 3ecf57e..aca23ea 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -1,5 +1,4 @@ #!/usr/bin/env sh -TIMEOUT=3 LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications trap "gracefulexit" INT TERM @@ -101,8 +100,8 @@ checkfornewtexts() { TEXTDATA="$(mmcli -m "$(modem_n)" -s "$TEXTID" -K)" TEXT="$(echo "$TEXTDATA" | grep sms.content.text | sed -E 's/^sms\.content\.text\s+:\s+//')" NUM="$( - echo "$TEXTDATA" | - grep sms.content.number | + echo "$TEXTDATA" | + grep sms.content.number | sed -E 's/^sms\.content\.number\s+:\s+//' )" TIME="$(echo "$TEXTDATA" | grep sms.properties.timestamp | sed -E 's/^sms\.properties\.timestamp\s+:\s+//')" @@ -127,12 +126,12 @@ checkfornewtexts() { mainloop() { checkformissedcalls dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \ - while read line; do + while read -r; do checkforincomingcalls checkformissedcalls done & dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \ - while read line; do + while read -r; do checkfornewtexts done & wait