From bfba94b93f51b666bfac981c4b3624472a2f7093 Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Sat, 31 Oct 2020 18:02:51 -0400 Subject: [PATCH] handle missing and uncreatable notifdirs more gracefully Original patch by ~kgp445 https://todo.sr.ht/~mil/sxmo-tickets/94 Signed-off-by: Anjandev Momi --- scripts/notifications/sxmo_notificationmonitor.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/notifications/sxmo_notificationmonitor.sh b/scripts/notifications/sxmo_notificationmonitor.sh index 8199216..3e49485 100755 --- a/scripts/notifications/sxmo_notificationmonitor.sh +++ b/scripts/notifications/sxmo_notificationmonitor.sh @@ -63,6 +63,9 @@ syncled() { monitorforaddordelnotifs() { while true; do + if [ ! -e "$NOTIFDIR" ]; then + mkdir -p "$NOTIFDIR" || sleep 10 + fi inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | ( INOTIFYOUTPUT="$(cat)" INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)"