Skip to content

Commit 015ebbe

Browse files
authored
Merge pull request #7 from devilbox/WAT-007
WAT-007 Minor output fixes and better description
2 parents af66bd7 + 279a248 commit 015ebbe

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/devilbox/watcherd.svg?branch=master)](https://travis-ci.org/devilbox/watcherd)
44

5-
watcherd will look for directory changes (added and deleted directories) under the specified path (`-p`) and will execute specified commands or shell scripts (`-a`, `-d`) depending on the event.
5+
**[watcherd](https://github.com/devilbox/watcherp/blob/master/watcherd)** will look for directory changes (added and deleted directories) under the specified path (`-p`) and will execute specified commands or shell scripts (`-a`, `-d`) depending on the event.
66
Once all events have happened during one round (`-i`), a trigger command can be executed (`-t`).
77
Note, the trigger command will only be execute when at least one add or delete command has succeeded with exit code 0.
88

@@ -14,7 +14,7 @@ If you need the same functionality to monitor changes of listening ports, check
1414

1515
### Modes
1616

17-
watcherd can either use the native [inotifywait](https://linux.die.net/man/1/inotifywait) implementation or if this is not available on your system use a custom bash implementation. The default is to use bash.
17+
**[watcherd](https://github.com/devilbox/watcherp/blob/master/watcherd)** can either use the native [inotifywait](https://linux.die.net/man/1/inotifywait) implementation or if this is not available on your system use a custom bash implementation. The default is to use bash.
1818

1919
### Placeholders
2020

@@ -27,7 +27,7 @@ You can specify the placeholders as many times as you want. See the following ex
2727

2828
### Examples
2929

30-
By using [vhost_gen.py](https://github.com/devilbox/vhost-gen) (which will create nginx vhost config files), the following will be able to create new nginx vhosts on-the-fly, simply by adding or deleting folders in your main www directory. The trigger command will simply force nginx to reload its configuration after directory changes occured.
30+
By using **[vhost_gen.py](https://github.com/devilbox/vhost-gen)** (which is capable of creating Nginx or Apache vhost config files for normal vhosts or reverse proxies), the following will be able to create new nginx vhosts on-the-fly, simply by adding or deleting folders in your main www directory. The trigger command will simply force nginx to reload its configuration after directory changes occured.
3131

3232
```shell
3333
# %n will be replaced by watcherd with the new directory name

watcherd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ IFS=$'\n'
2525

2626
# Versioning
2727
MY_NAME="watcherd"
28-
MY_DATE="2017-09-29"
28+
MY_DATE="2017-09-30"
2929
MY_URL="https://github.com/devilbox/watcherd"
3030
MY_AUTHOR="cytopia <[email protected]>"
3131
MY_GPGKEY="0xA02C56F0"
@@ -298,11 +298,11 @@ if [ "${WATCHER}" = "inotify" ]; then
298298
"${WATCH_DIR}" | while read -r output; do
299299
d="${output##*\\}"
300300
if [[ "${output}" =~ ^(CREATE|MOVED_TO),ISDIR/\\ ]]; then
301-
if action "${d}" "${CMD_ADD}" "ADD" "${VERBOSE}"; then
301+
if action "${d}" "${CMD_ADD}" "ADD:" "${VERBOSE}"; then
302302
trigger "${CMD_TRIGGER}" "1" "${VERBOSE}"
303303
fi
304304
elif [[ "${output}" =~ ^(DELETE|MOVED_FROM),ISDIR/\\ ]]; then
305-
if action "${d}" "${CMD_DEL}" "DEL" "${VERBOSE}"; then
305+
if action "${d}" "${CMD_DEL}" "DEL:" "${VERBOSE}"; then
306306
trigger "${CMD_TRIGGER}" "1" "${VERBOSE}"
307307
fi
308308
fi
@@ -329,14 +329,14 @@ else
329329

330330
# Run ADD command
331331
for d in $ADD_DIRS; do
332-
if action "${d}" "${CMD_ADD}" "ADD" "${VERBOSE}"; then
332+
if action "${d}" "${CMD_ADD}" "ADD:" "${VERBOSE}"; then
333333
CHANGES=1
334334
fi
335335
done
336336

337337
# Run DEL command
338338
for d in $DEL_DIRS; do
339-
if action "${d}" "${CMD_DEL}" "DEL" "${VERBOSE}"; then
339+
if action "${d}" "${CMD_DEL}" "DEL:" "${VERBOSE}"; then
340340
CHANGES=1
341341
fi
342342
done

0 commit comments

Comments
 (0)