0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-20 02:46:10 +02:00

change from using find to using a for-loop to located the .sh files

Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
This commit is contained in:
Dennis Vestergaard Værum 2023-06-11 14:55:48 +02:00 committed by J0WI (Rebase PR Action)
parent a31036f574
commit e9e834b6bc
2 changed files with 3 additions and 4 deletions

View file

@ -216,7 +216,7 @@ To use the hooks triggered by the `entrypoint` script, either
- Added your script(s) to the individual of the hook folder(s), which are located at the path `/docker-entrypoint-hooks.d` in the container
- Use volume(s) if you want to use script from the host system inside the container, see example.
**Note:** Only the script(s) ending with `.sh` and marked as executable will be executed.
**Note:** Only the script(s) located in a hook folder (not sub-folders), ending with `.sh` and marked as executable, will be executed.
**Example:** Mount using volumes
```yaml

View file

@ -27,14 +27,13 @@ run_path() {
echo "=> Searching for scripts (*.sh) to run in the folder: ${hook_folder_path}"
(
cd "${hook_folder_path}"
find . -type f -iname '*.sh' -print | sort | while read script_file_path; do
for script_file_path in "${hook_folder_path}/"*.sh; do
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
continue
fi
echo "==> Running the script: \"${script_file_path}\""
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
run_as "${script_file_path}" || return_code="$?"