@@ -29,7 +29,7 @@ MY_DATE="2022-12-17"
2929MY_URL=" https://github.com/devilbox/watcherd"
3030MY_AUTHOR=
" cytopia <[email protected] >" 3131MY_GPGKEY=" 0xA02C56F0"
32- MY_VERSION=" 1.0.4 "
32+ MY_VERSION=" 1.0.5 "
3333MY_LICENSE=" MIT"
3434
3535# Default settings
@@ -152,11 +152,11 @@ function trigger() {
152152 if [ " ${changes} " -eq " 1" ]; then
153153 if eval " ${action} " ; then
154154 if [ " ${verbose} " -gt " 0" ]; then
155- printf " %s: [%s] [OK] %s succeeded: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRIGGER " " ${action} "
155+ printf " %s: [%s] [OK] %s succeeded: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRG " " ${action} "
156156 fi
157157 return 0
158158 else
159- printf " %s: [%s] [ERR] %s failed: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRIGGER " " ${action} " >&2
159+ printf " %s: [%s] [ERR] %s failed: %s\\ n" " ${MY_NAME} " " $( date ' +%Y-%m-%d %H:%M:%S' ) " " TRG " " ${action} " >&2
160160 # Also return 0 here in order to not abort the loop
161161 return 0
162162 fi
283283# Initial add
284284for d in ${ALL_DIRS} ; do
285285 # Only CHANGE if adding was successful
286- if action " ${d} " " ${CMD_ADD} " " ADD: " " ${VERBOSE} " ; then
286+ if action " ${d} " " ${CMD_ADD} " " ADD" " ${VERBOSE} " ; then
287287 CHANGES=1
288288 fi
289289done
@@ -311,11 +311,11 @@ if [ "${WATCHER}" = "inotify" ]; then
311311 " ${WATCH_DIR} " | while read -r output; do
312312 d=" ${output##* \\ } "
313313 if [[ " ${output} " =~ ^(CREATE| MOVED_TO),ISDIR/\\ ]]; then
314- if action " ${d} " " ${CMD_ADD} " " ADD: " " ${VERBOSE} " ; then
314+ if action " ${d} " " ${CMD_ADD} " " ADD" " ${VERBOSE} " ; then
315315 trigger " ${CMD_TRIGGER} " " 1" " ${VERBOSE} "
316316 fi
317317 elif [[ " ${output} " =~ ^(DELETE| MOVED_FROM),ISDIR/\\ ]]; then
318- if action " ${d} " " ${CMD_DEL} " " DEL: " " ${VERBOSE} " ; then
318+ if action " ${d} " " ${CMD_DEL} " " DEL" " ${VERBOSE} " ; then
319319 trigger " ${CMD_TRIGGER} " " 1" " ${VERBOSE} "
320320 fi
321321 fi
@@ -342,14 +342,14 @@ else
342342
343343 # Run ADD command
344344 for d in $ADD_DIRS ; do
345- if action " ${d} " " ${CMD_ADD} " " ADD: " " ${VERBOSE} " ; then
345+ if action " ${d} " " ${CMD_ADD} " " ADD" " ${VERBOSE} " ; then
346346 CHANGES=1
347347 fi
348348 done
349349
350350 # Run DEL command
351351 for d in $DEL_DIRS ; do
352- if action " ${d} " " ${CMD_DEL} " " DEL: " " ${VERBOSE} " ; then
352+ if action " ${d} " " ${CMD_DEL} " " DEL" " ${VERBOSE} " ; then
353353 CHANGES=1
354354 fi
355355 done
0 commit comments