Fix shellcheck

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

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

@ -54,19 +54,20 @@ recreateexistingnotifs() {
monitorforaddordelnotifs() { monitorforaddordelnotifs() {
while true; do 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"/ | ( inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | (
INOTIFYOUTPUT="$(cat)" INOTIFYOUTPUT="$(cat)"
INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)" INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)"
echo "$INOTIFYEVENTTYPE" | grep -E "CREATE|MOVED_TO|ATTRIB" || continue if echo "$INOTIFYEVENTTYPE" | grep -E "CREATE|MOVED_TO|ATTRIB"; then
NOTIFFILE="$NOTIFDIR/$(echo "$INOTIFYOUTPUT" | cut -d" " -f3)" NOTIFFILE="$NOTIFDIR/$(echo "$INOTIFYOUTPUT" | cut -d" " -f3)"
handlenewnotiffile "$NOTIFFILE" handlenewnotiffile "$NOTIFFILE"
fi
) & wait ) & wait
done done
} }
pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill
rm -f $NOTIFDIR/incomingcall rm -f "$NOTIFDIR"/incomingcall
recreateexistingnotifs recreateexistingnotifs
monitorforaddordelnotifs monitorforaddordelnotifs

Loading…
Cancel
Save