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
This commit is contained in:
Kenichi Omichi 2019-03-09 00:39:23 +00:00 committed by Carlos Goncalves
parent ff1a4761be
commit 6c0af86e4c
1 changed files with 8 additions and 0 deletions

View File

@ -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