Created
May 10, 2023 11:51
-
-
Save radmiraal/a1d274905f55d87dce6f9e8cbd453c6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DOMAIN="my.host.name" | |
SERVER_PATH="/opt/FileMaker/FileMaker Server/" | |
FMADMIN="admin" | |
FMPASS="my fancy password" | |
cp "/etc/letsencrypt/live/${DOMAIN}/fullchain.pem" "${SERVER_PATH}CStore/fullchain.pem" | |
cp "/etc/letsencrypt/live/${DOMAIN}/privkey.pem" "${SERVER_PATH}CStore/privkey.pem" | |
chmod 640 "${SERVER_PATH}CStore/privkey.pem" | |
# Move an old certificate, if there is one, to prevent an error | |
# changed to server.pem as that seems to be used by fm now instead | |
mv "${SERVER_PATH}CStore/server.pem" "${SERVER_PATH}CStore/serverKey-old.pem" | |
# Remove the old certificate | |
fmsadmin certificate delete --yes -u ${FMADMIN} -p ${FMPASS} | |
# Install the certificate | |
fmsadmin certificate import "${SERVER_PATH}CStore/fullchain.pem" --keyfile "${SERVER_PATH}CStore/privkey.pem" -y -u ${FMADMIN} -p ${FMPASS} | |
systemctl restart fmshelper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment