-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Hi all!
You allow to run custom script via hooks here.
First you're looking for any files in hook directory:
if [ -z "$(ls -A "${hook_folder_path}")" ]; thenThen you iterate over *.sh files:
for script_file_path in "${hook_folder_path}/"*.sh; doThe problem is when hook directory contains some file(s) which don't have *.sh extension. if condition pass but for loop will give an one empty file and this will create an issue:
nextcloud_1 | => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-upgrade
nextcloud_1 | ==> Running the script (cwd: /var/www/html): "/docker-entrypoint-hooks.d/pre-upgrade/*.sh"
nextcloud_1 | sh: 1: /docker-entrypoint-hooks.d/pre-upgrade/*.sh: not found
nextcloud_1 | ==> Failed at executing "/docker-entrypoint-hooks.d/pre-upgrade/*.sh". Exit code: 127
Here is my little hack to omit this. Create empty.sh file.
I think you should change ls -A ${hook_folder_path} with find ${hook_folder_path} -name "*.sh"
Reactions are currently unavailable