2018-05-28 12:51:36 +10:00
|
|
|
#!/bin/bash
|
|
|
|
# Script Name: ssl-install
|
|
|
|
# Author: Matt McKinnon
|
|
|
|
# Date: 28th May 2018
|
|
|
|
# Description:
|
|
|
|
#
|
|
|
|
# Script used to copy Let's Encrypt Generated Certificates from generating server to ESXi VPS Server.
|
|
|
|
# This script requires acme.sh be used to setup your Let's Encrypt Certificates.
|
|
|
|
# - https://github.com/Neilpang/acme.sh
|
|
|
|
#
|
|
|
|
# SSH Key Login also needs to be enabled on ESXi
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2018-08-26 11:55:54 +10:00
|
|
|
DOM_NAME="comprofix.com"
|
|
|
|
ESXI_SERVER="esxi.comprofix.com"
|
2018-05-28 12:51:36 +10:00
|
|
|
|
|
|
|
|
2018-08-26 11:55:54 +10:00
|
|
|
if [ ! -d $HOME/.acme.sh ]; then
|
2018-05-28 12:51:36 +10:00
|
|
|
echo "Folder does not exist"
|
|
|
|
exit 0
|
|
|
|
else
|
2018-08-26 11:55:54 +10:00
|
|
|
echo "You are using acme.sh. Well done"
|
|
|
|
|
2018-05-28 12:51:36 +10:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
scp -q ~/.acme.sh/$DOM_NAME/$DOM_NAME.cer root@$ESXI_SERVER:/etc/vmware/ssl/rui.crt
|
|
|
|
scp -q ~/.acme.sh/$DOM_NAME/$DOM_NAME.key root@$ESXI_SERVER:/etc/vmware/ssl/rui.key
|
2018-08-26 11:55:54 +10:00
|
|
|
#ssh -qt root@$ESXI_SERVER "/sbin/services.sh restart"
|
|
|
|
ssh -qt root@$ESXI_SERVER "/etc/init.d/hostd restart"
|
|
|
|
ssh -qt root@$ESXI_SERVER "/etc/init.d/vpxa restart"
|
2018-05-28 12:51:36 +10:00
|
|
|
|
|
|
|
|
|
|
|
|