Last active
November 13, 2018 04:32
-
-
Save justintime/e1932b89ea9debad3eb6166b3fff40bb to your computer and use it in GitHub Desktop.
Certbot renewal for Powershell Empire
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
#!/bin/bash | |
service apache2 status | |
prevstatus=$? | |
if [ $prevstatus -ne 0 ]; then | |
echo "Apache stopped, starting now." | |
service apache2 start | |
fi | |
certbot renew | |
diff /opt/Empire/data/empire-chain.pem /etc/letsencrypt/live/thp3-c2.h3r3.tk/fullchain.pem | |
rv=$? | |
if [ $rv -ne 0 ]; then | |
echo | |
echo | |
echo "Key was updated, copying to Empire" | |
cp /etc/letsencrypt/live/thp3-c2.h3r3.tk/fullchain.pem /opt/Empire/data/empire-chain.pem | |
cp /etc/letsencrypt/live/thp3-c2.h3r3.tk/privkey.pem /opt/Empire/data/empire-priv.key | |
fi | |
if [ $prevstatus -ne 0 ]; then | |
echo "Returning apache to stopped state." | |
service apache2 stop | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment