diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-02-25 22:50:51 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-02-25 22:57:28 +0100 |
commit | 36e26346f0d928fa2660c063210e0271f5f5fc2a (patch) | |
tree | fa8568b6c3b5b475be6541676b3213727d7dfb78 /docker | |
parent | remove dead code (diff) | |
download | cgitize-36e26346f0d928fa2660c063210e0271f5f5fc2a.tar.gz cgitize-36e26346f0d928fa2660c063210e0271f5f5fc2a.zip |
docker: ignore missing config file
It allows doing something like
docker run -it --rm egortensin/cgitize:latest sh
(without the missing file errors).
Diffstat (limited to '')
-rwxr-xr-x | docker/entrypoint.sh | 10 |
1 files 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" "$@" } |