diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-18 15:18:05 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-18 15:18:05 +0200 |
commit | 94edfe8c7b2f83650c0f6262e50063ebcdedf29d (patch) | |
tree | 08d8f57b1e29d01ae3981c91492c11c2a5f45c7b /rolling-directory | |
parent | c6d84a192db8abf037ad08de0379177e5f56b952 (diff) | |
download | utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.gz utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.bz2 utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.xz utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.zip |
minSleep
Diffstat (limited to 'rolling-directory')
-rw-r--r-- | rolling-directory | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/rolling-directory b/rolling-directory index d85f8b7..ce97021 100644 --- a/rolling-directory +++ b/rolling-directory | |||
@@ -33,16 +33,25 @@ case "${1}" in | |||
33 | monitor) | 33 | monitor) |
34 | shift | 34 | shift |
35 | 35 | ||
36 | sleep="" | ||
36 | typeset -a inotifyExtra | 37 | typeset -a inotifyExtra |
37 | inotifyExtra=() | 38 | inotifyExtra=() |
38 | 39 | ||
39 | if [[ "${1}" = <-> ]]; then | 40 | while getopts 's:t:' opt; do |
40 | inotifyExtra=(-t "${1}") | 41 | case "${opt}" in |
41 | shift | 42 | s) |
42 | fi | 43 | [[ "${OPTARG}" = <-> ]] || exit 2 |
44 | sleep=${OPTARG} | ||
45 | ;; | ||
46 | t) | ||
47 | [[ "${OPTARG}" = <-> ]] || exit 2 | ||
48 | inotifyExtra+=(-t "${OPTARG}") | ||
49 | esac | ||
50 | done | ||
43 | 51 | ||
44 | while | 52 | while |
45 | resize | 53 | resize |
54 | [[ -n "$sleep" ]] && sleep ${sleep} | ||
46 | inotifywait -qq -r ${dir} ${inotifyExtra} \ | 55 | inotifywait -qq -r ${dir} ${inotifyExtra} \ |
47 | -e modify \ | 56 | -e modify \ |
48 | -e close_write \ | 57 | -e close_write \ |