fix: auto-trigger hooks at first run
This commit is contained in:
parent
26a3d22882
commit
a19c45cea7
1 changed files with 4 additions and 1 deletions
|
|
@ -83,11 +83,14 @@ start_hook_daemon(){
|
|||
# 86400 secs = 1 day 3600 = 1 hour
|
||||
$0 infinite 86400 hook daily &
|
||||
$0 infinite 3600 hook hourly &
|
||||
# trigger hooks when files change in /mnt/experiences
|
||||
# trigger hooks when files change in /mnt
|
||||
find /mnt -type d -mindepth 1 -maxdepth 1 | while read dir; do
|
||||
echocolor "[$APPNAME]" "listening to inotify events in $dir"
|
||||
inotifywait -r -m $dir | awk '$2 ~ /(CREATE|MODIFY|MOVED_TO|DELETE)/ { system("'$0' hook inotify_"$2" "$1""$3) }' &
|
||||
done
|
||||
|
||||
# force-trigger processing hooks in /mnt
|
||||
find /mnt | grep datapackage | xargs -n1 $0 hook inotify_MODIFY
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue