-->

#!/bin/bash
#
LIVE_PATH=「letsencrypt/live下のサイトフォルダ」
TOMCAT_PATH=「tomcatのconfフォルダ」
PASS=「パスワードの文字列」
CHAIN_PATH="${LIVE_PATH}"「fullchainのファイル名」
PEM_PATH="${LIVE_PATH}"「privkeyのファイル名」
P12_PATH="${LIVE_PATH}"「pkcs12のファイル名」
JKS_FROM_PATH="${LIVE_PATH}"「keystoreのファイル名」
JKS_TO_PATH="${TOMCAT_PATH}"「keystoreのファイル名」
sudo rm -r "${P12_PATH}"
#pkcs12ファイルを作成
sudo openssl pkcs12 -export -in "${CHAIN_PATH}" -inkey "${PEM_PATH}" -out "${P12_PATH}" -password pass:"${PASS}"
#keystoreを作成
sudo keytool -importkeystore -destkeystore "${JKS_FROM_PATH}" -srckeystore "${P12_PATH}" -srcstoretype PKCS12 -srcstorepass "${PASS}" -deststorepass "${PASS}"
#keystoreをtomcatへコピー
sudo mv -f "${JKS_FROM_PATH}" "${JKS_TO_PATH}"
#tomcatを再起動
sudo service tomcat restart
# EOF

sudo certbot renew --dry-run --run-deploy-hooks
Congratulations, all simulated renewals succeeded:
Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: argument -v/--verbose: ignored explicit argument 'ersion'