diff options
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 \ |
