#!/bin/bash # Certificate directory on the server CERT_DIR="/etc/apache2/certs/WEB_SITE" # NPM certificate directory CERT_DIR_NPM="npm-1" # Mounting the certificate directory mount -t nfs4 IP_OMV:/certs/$CERT_DIR_NPM /mnt/nfs/cert # Copying certificates to the server cp /mnt/nfs/cert/privkey.pem $CERT_DIR/privkey.pem cp /mnt/nfs/cert/fullchain.pem $CERT_DIR/fullchain.pem # Changing certificate permissions chmod 400 $CERT_DIR/privkey.pem # Restart Apache2 systemctl restart apache2 # or Restart NGINX #service nginx restart # Unmounting the certificate directory umount -t nfs4 IP_OMV:/certs/$CERT_DIR_NPM /mnt/nfs/cert history -c reset