From 36e26346f0d928fa2660c063210e0271f5f5fc2a Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 25 Feb 2023 22:50:51 +0100 Subject: docker: ignore missing config file It allows doing something like docker run -it --rm egortensin/cgitize:latest sh (without the missing file errors). --- docker/entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 786bcc6..35ef3e3 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -15,8 +15,10 @@ readonly script_dir readonly cfg_path=/etc/cgitize/cgitize.toml secure_repo_dir() { + [ ! -e "$cfg_path" ] && return 0 + local dir - dir="$( /get_output_dir.py -- "$cfg_path" )" + dir="$( "$script_dir/get_output_dir.py" -- "$cfg_path" )" chmod -- o-rwx "$dir" @@ -26,8 +28,12 @@ secure_repo_dir() { chown -- :101 "$dir" } -main() { +setup() { secure_repo_dir +} + +main() { + setup exec "$script_dir/run_cron.sh" "$@" } -- cgit v1.2.3