Fix shellcheck

master
Miles Alan 4 years ago
parent 24c650ee49
commit 747da7863c
  1. 3
      scripts/modem/sxmo_modemmonitor.sh
  2. 11
      scripts/notifications/sxmo_notificationmonitor.sh

@ -40,7 +40,7 @@ checkformissedcalls() {
grep -oE "Call\/[0-9]+" |
cut -d'/' -f2
); do
MISSEDNUMBER="$(lookupnumberfromcallid $MISSEDCALLID)"
MISSEDNUMBER="$(lookupnumberfromcallid "$MISSEDCALLID")"
mmcli -m "$(modem_n)" --voice-delete-call "$MISSEDCALLID"
TIME="$(date --iso-8601=seconds)"
@ -48,7 +48,6 @@ checkformissedcalls() {
printf %b "$TIME\tcall_missed\t$MISSEDNUMBER\n" >> "$LOGDIR/modemlog.tsv"
CONTACT="$(sxmo_contacts.sh | grep -E "^$MISSEDNUMBER")"
RUNCOMMAND=""
sxmo_notificationwrite.sh \
random \
"st -f Terminus-20 -e sh -c \"echo 'Missed call from $CONTACT at $(date)' && read\"" \

@ -54,19 +54,20 @@ recreateexistingnotifs() {
monitorforaddordelnotifs() {
while true; do
[ $(find "$NOTIFDIR"/ -type f | wc -l) -lt 1 ] && sxmo_setpineled green 0
[ "$(find "$NOTIFDIR"/ -type f | wc -l)" -lt 1 ] && sxmo_setpineled green 0
inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | (
INOTIFYOUTPUT="$(cat)"
INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)"
echo "$INOTIFYEVENTTYPE" | grep -E "CREATE|MOVED_TO|ATTRIB" || continue
NOTIFFILE="$NOTIFDIR/$(echo "$INOTIFYOUTPUT" | cut -d" " -f3)"
handlenewnotiffile "$NOTIFFILE"
if echo "$INOTIFYEVENTTYPE" | grep -E "CREATE|MOVED_TO|ATTRIB"; then
NOTIFFILE="$NOTIFDIR/$(echo "$INOTIFYOUTPUT" | cut -d" " -f3)"
handlenewnotiffile "$NOTIFFILE"
fi
) & wait
done
}
pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill
rm -f $NOTIFDIR/incomingcall
rm -f "$NOTIFDIR"/incomingcall
recreateexistingnotifs
monitorforaddordelnotifs

Loading…
Cancel
Save