Skip to content

Commit

Permalink
PMM-12738 Print all errors together.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Dec 20, 2023
1 parent e2ed5b0 commit dfeebf0
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,39 @@ set -o errexit
mkdir -p /srv/nginx
if [ ! -w "/srv/nginx" ]; then
echo "Directory /srv/nginx is not writable";
error=false
if [ ! -e /srv/nginx/certificate.key ]
then
echo "The file /srv/nginx/certificate.key does not exist. Exiting...";
exit 1;
echo "The file /srv/nginx/certificate.key does not exist." >&2
error=true
fi

if [ ! -e /srv/nginx/certificate.crt ]
then
echo "The file /srv/nginx/certificate.crt does not exist. Exiting...";
exit 1;
echo "The file /srv/nginx/certificate.crt does not exist." >&2
error=true
fi

if [ ! -e /srv/nginx/ca-certs.pem ]
then
echo "The file /srv/nginx/ca-certs.pem does not exist. Exiting...";
exit 1;
echo "The file /srv/nginx/ca-certs.pem does not exist." >&2
error=true
fi

if [ ! -e /srv/nginx/dhparam.pem ]
then
echo "The file /srv/nginx/dhparam.pem does not exist. Exiting...";
exit 1;
echo "The file /srv/nginx/dhparam.pem does not exist." >&2
error=true
fi

echo "Using existing self-signed certificate";
exit 0;
if [ "$error" = true ]
then
echo "Exiting due to missing file(s)." >&2
exit 1;
else
echo "Using existing self-signed certificate.";
exit 0;
fi
fi

if [ ! -e /srv/nginx/dhparam.pem ]; then
Expand Down

0 comments on commit dfeebf0

Please sign in to comment.