mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
Watch the whole folder
Exclude sample and md
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
# Auto-reload - Docker mod for Nginx based images
|
# Auto-reload - Docker mod for Nginx based images
|
||||||
|
|
||||||
This mod allows Nginx to be reloaded automatically whenever there are valid changes to the `*.conf` files in `/config/nginx` or any files in the following folders:
|
This mod allows Nginx to be reloaded automatically whenever there are new files, or valid changes to the files in `/config/nginx`.
|
||||||
|
|
||||||
- /config/nginx/proxy-confs
|
|
||||||
- /config/nginx/site-confs
|
|
||||||
|
|
||||||
In the container's docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:swag-auto-reload`
|
In the container's docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:swag-auto-reload`
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
DEFAULT_WATCH=()
|
|
||||||
mapfile -t DEFAULT_WATCH < <(find /config/nginx -type f -name '*.conf' -print)
|
|
||||||
DEFAULT_WATCH+=("/config/nginx/proxy-confs" "/config/nginx/site-confs")
|
|
||||||
|
|
||||||
# start with an empty array for active watch
|
|
||||||
ACTIVE_WATCH=()
|
|
||||||
echo "MOD Auto-reload: Watching the following files/folders for changes"
|
|
||||||
for i in "${DEFAULT_WATCH[@]}"; do
|
|
||||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
|
||||||
echo "${i}"
|
|
||||||
ACTIVE_WATCH+=("${i}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
for i in $(echo "${WATCHLIST}" | tr "|" " "); do
|
|
||||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
|
||||||
echo "${i}"
|
|
||||||
ACTIVE_WATCH+=("${i}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
function wait_for_changes {
|
function wait_for_changes {
|
||||||
inotifywait -rq \
|
inotifywait -rq \
|
||||||
--event modify,move,create,delete \
|
--event modify,move,create,delete \
|
||||||
"${ACTIVE_WATCH[@]}"
|
--excludei '\.(sample|md)' \
|
||||||
|
"/config/nginx"
|
||||||
}
|
}
|
||||||
|
|
||||||
while wait_for_changes; do
|
while wait_for_changes; do
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
DEFAULT_WATCH=()
|
|
||||||
mapfile -t DEFAULT_WATCH < <(find /config/nginx -type f -name '*.conf' -print)
|
|
||||||
DEFAULT_WATCH+=("/config/nginx/proxy-confs" "/config/nginx/site-confs")
|
|
||||||
|
|
||||||
# start with an empty array for active watch
|
|
||||||
ACTIVE_WATCH=()
|
|
||||||
echo "MOD Auto-reload: Watching the following files/folders for changes"
|
|
||||||
for i in "${DEFAULT_WATCH[@]}"; do
|
|
||||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
|
||||||
echo "${i}"
|
|
||||||
ACTIVE_WATCH+=("${i}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
for i in $(echo "${WATCHLIST}" | tr "|" " "); do
|
|
||||||
if [ -f "${i}" ] || [ -d "${i}" ]; then
|
|
||||||
echo "${i}"
|
|
||||||
ACTIVE_WATCH+=("${i}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
function wait_for_changes {
|
function wait_for_changes {
|
||||||
inotifywait -rq \
|
inotifywait -rq \
|
||||||
--event modify,move,create,delete \
|
--event modify,move,create,delete \
|
||||||
"${ACTIVE_WATCH[@]}"
|
--excludei '\.(sample|md)' \
|
||||||
|
"/config/nginx"
|
||||||
}
|
}
|
||||||
|
|
||||||
while wait_for_changes; do
|
while wait_for_changes; do
|
||||||
|
|||||||
Reference in New Issue
Block a user