mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
Fix logic
This commit is contained in:
parent
a6de1bfc19
commit
d83f92e007
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user