i have the following bash code written to detect if a SSL certificate exists and if so to skip the creation of one.
i need to expand the list of detected files, so that the presence of any of them will skip the creation of the SSL certificate.
the full list of files are "trailers.cer" or "trailers.key" or "trailers.pem"
An alterntaive approach is after detection, prompt the user asking if they want to create SSL certifictes
file="assets/certificates/trailers.cer"
if [ -f "$file" ]; then
echo 'SSL Certificates already created'
else
openssl req -new -nodes -newkey rsa:2048 -out ./assets/certificates/trailers.pem -keyout ./assets/certificates/trailers.key -x509 -days 7300 -subj "/C=US/CN=trailers.apple.com"
openssl x509 -in ./assets/certificates/trailers.pem -outform der -out ./assets/certificates/trailers.cer && cat ./assets/certificates/trailers.key >> ./assets/certificates/trailers.pem
fi