From 6c0af86e4cdde72c5dd9f825c30ce2d7cb653ef8 Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Sat, 9 Mar 2019 00:39:23 +0000 Subject: [PATCH] Add error-handling for permission of /etc/octavia create_certificates.sh requires permission of /etc/octavia basically and creates certificates under that. If not granting enough permission the script creates these files under current directory and that makes mess. So this patch adds minimum error-handling for avoiding that. Change-Id: I5166329a7c45c8f17890f11af99bedb206144de5 --- bin/create_certificates.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/create_certificates.sh b/bin/create_certificates.sh index 0e5b5af9b9..bba338811c 100755 --- a/bin/create_certificates.sh +++ b/bin/create_certificates.sh @@ -41,7 +41,15 @@ echo $CERT_DIR mkdir -p $CERT_DIR cd $CERT_DIR +if [[ $? -ne 0 ]]; then + echo "Failed to change to $CERT_DIR. Check the existence and permission" + exit 1 +fi mkdir newcerts private +if [[ $? -ne 0 ]]; then + echo "Failed to create directories. Check the permission" + exit 1 +fi chmod 700 private # prepare files