]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Fix: kvmx: inotify: restrict events
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 14 Jul 2024 23:24:27 +0000 (20:24 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 14 Jul 2024 23:24:27 +0000 (20:24 -0300)
kvmx

diff --git a/kvmx b/kvmx
index e912f84005a115024d6ca128afb3e5fbe142d11d..b5098ea76f58e6eb872478a2f36bd62dc989c128 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -2582,8 +2582,19 @@ function kvmx_inotify {
     exit 1
   fi
 
+  # Exclude "access", "close", "close_write", "close_nowrite", "open" from the list of events
+  local args
+  local event
+  local events="modify attrib moved_to moved_from move"
+        events="$events move_self create delete delete_self unmount"
+
+  # Build arg list of events
+  for event in $events; do
+    args="$args -e $event"
+  done
+
   # Dispatch
-  while inotifywait -r $watched; do
+  while inotifywait $args -r $watched; do
     echo "$command" | kvmx_ssh
   done
 }