diff --git a/root/etc/s6-overlay/s6-rc.d/svc-mod-swag-auto-reload/run b/root/etc/s6-overlay/s6-rc.d/svc-mod-swag-auto-reload/run index 06d3b88..1e92149 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-mod-swag-auto-reload/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-mod-swag-auto-reload/run @@ -1,11 +1,21 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash +echo "MOD Auto-reload: Watching the following files/folders for changes (excluding .sample and .md files):" +echo "/config/nginx" +ACTIVE_WATCH=("/config/nginx") +for i in $(echo "${WATCHLIST}" | tr "|" " "); do + if [ -f "${i}" ] || [ -d "${i}" ]; then + echo "${i}" + ACTIVE_WATCH+=("${i}") + fi +done + function wait_for_changes { inotifywait -rq \ --event modify,move,create,delete \ --excludei '\.(sample|md)' \ - "/config/nginx" + "${ACTIVE_WATCH[@]}" } while wait_for_changes; do diff --git a/root/etc/services.d/inotify/run b/root/etc/services.d/inotify/run index 06d3b88..1e92149 100755 --- a/root/etc/services.d/inotify/run +++ b/root/etc/services.d/inotify/run @@ -1,11 +1,21 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash +echo "MOD Auto-reload: Watching the following files/folders for changes (excluding .sample and .md files):" +echo "/config/nginx" +ACTIVE_WATCH=("/config/nginx") +for i in $(echo "${WATCHLIST}" | tr "|" " "); do + if [ -f "${i}" ] || [ -d "${i}" ]; then + echo "${i}" + ACTIVE_WATCH+=("${i}") + fi +done + function wait_for_changes { inotifywait -rq \ --event modify,move,create,delete \ --excludei '\.(sample|md)' \ - "/config/nginx" + "${ACTIVE_WATCH[@]}" } while wait_for_changes; do