serverscripts/ssl-install

38 lines
978 B
Plaintext
Raw Normal View History

#!/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-11-01 14:51:26 +10:00
DOM_NAME="home.comprofix.com"
ESXI_SERVER="esxi.home.comprofix.com"
2018-08-26 11:55:54 +10:00
if [ ! -d $HOME/.acme.sh ]; then
echo "Folder does not exist"
exit 0
else
2018-08-26 11:55:54 +10:00
echo "You are using acme.sh. Well done"
fi
2018-11-01 14:51:26 +10:00
scp ~/.acme.sh/$DOM_NAME/$DOM_NAME.cer root@$ESXI_SERVER:/etc/vmware/ssl/rui.crt
scp ~/.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"
2018-11-01 14:51:26 +10:00
ssh -t root@$ESXI_SERVER "/etc/init.d/hostd restart"
ssh -t root@$ESXI_SERVER "/etc/init.d/vpxa restart"