yum install -y -q -e 0 unzip; for folder in /certs/certs/*/ ; do rm -Rf $folder done if [[ ! -f /certs/certs/bundle.zip ]]; then bin/elasticsearch-certutil \ cert \ --silent \ --days 365 \ --pem \ --in config/certificates/instances.yml \ -out /certs/certs/bundle.zip; unzip /certs/certs/bundle.zip -d /certs/certs; rm /certs/certs/bundle.zip; fi; for file in /certs/certs/*/*.key ; do openssl pkcs8 -in $file \ -topk8 -nocrypt -out ${file/.key/.pkcs8.key}; done chown -R 1000:0 /certs/certs