summaryrefslogtreecommitdiff
path: root/system/gd/cert/change_waiter.py
blob: 30a72f9671f0445f544a714231be134999509d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pyinotify
import sys

wm = pyinotify.WatchManager()
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY


class EventHandler(pyinotify.ProcessEvent):

    def process_default(self, event):
        quit()


handler = EventHandler()
notifier = pyinotify.Notifier(wm, handler)
wdd = wm.add_watch(sys.argv[1], mask, rec=True)

notifier.loop()