From 570d00df2df7209c6abd454f7357712b5c489bd8 Mon Sep 17 00:00:00 2001 From: Olivier Levitt Date: Fri, 7 Apr 2023 10:54:49 +0200 Subject: [PATCH] Fix keytool error at startup (#209) --- onyxia-api/entrypoint.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/onyxia-api/entrypoint.sh b/onyxia-api/entrypoint.sh index 4d0ea470..d64bfb0f 100755 --- a/onyxia-api/entrypoint.sh +++ b/onyxia-api/entrypoint.sh @@ -1,11 +1,16 @@ #!/bin/bash # Import CA certificates to Java keystore -for file in $CACERTS_DIR/* -do - echo "Adding $file to keystore" - keytool -import -cacerts -trustcacerts -noprompt -storepass changeit -alias $(basename $file) -file $file -done +if [[ -n "$CACERTS_DIR" ]]; then + for file in $CACERTS_DIR/* + do + if [ -f "$file" ] + then + echo "Adding $file to keystore" + keytool -import -cacerts -trustcacerts -noprompt -storepass changeit -alias $(basename $file) -file $file + fi + done +fi # Run application java -jar /app.jar