make modemmonitor's dbus hooks more robust and prevent being triggered multiple times

master
Maarten van Gompel 4 years ago
parent 9a4df9fd28
commit a42f160ed2
  1. 6
      scripts/modem/sxmo_modemmonitor.sh

@ -165,19 +165,19 @@ mainloop() {
# Monitor for incoming calls # Monitor for incoming calls
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \ dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \
while read -r line; do while read -r line; do
checkforincomingcalls echo "$line" | grep -E "^signal" && checkforincomingcalls
done & done &
# Monitor for incoming texts # Monitor for incoming texts
dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \ dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \
while read -r line; do while read -r line; do
checkfornewtexts echo "$line" | grep -E "^signal" && checkfornewtexts
done & done &
# Monitor for finished calls # Monitor for finished calls
dbus-monitor --system "interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',arg0='org.freedesktop.ModemManager1.Call'" | \ dbus-monitor --system "interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',arg0='org.freedesktop.ModemManager1.Call'" | \
while read -r line; do while read -r line; do
checkforfinishedcalls echo "$line" | grep -E "^signal" && checkforfinishedcalls
done & done &
wait wait

Loading…
Cancel
Save