Fix shellcheck

This commit is contained in:
Miles Alan 2020-08-22 16:45:49 -05:00
parent 24c650ee49
commit 747da7863c
2 changed files with 7 additions and 7 deletions

View file

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