Adjusting Cron Jobs
This commit is contained in:
parent
bf2d3308a6
commit
c86d4a02e9
4 changed files with 19 additions and 4 deletions
|
|
@ -6,4 +6,3 @@
|
||||||
0 3 * * 6 run-parts /etc/periodic/weekly
|
0 3 * * 6 run-parts /etc/periodic/weekly
|
||||||
0 5 1 * * run-parts /etc/periodic/monthly
|
0 5 1 * * run-parts /etc/periodic/monthly
|
||||||
* * * * * /scripts/haproxy-reload.sh
|
* * * * * /scripts/haproxy-reload.sh
|
||||||
*/2 * * * * /scripts/certbot.sh
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Semaphore
|
||||||
|
if [ -f /tmp/certbot-lock ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /tmp/certbot-lock
|
||||||
|
|
||||||
mkdir -p /var/log/letsencrypt
|
mkdir -p /var/log/letsencrypt
|
||||||
ln -sf /dev/stdout /var/log/letsencrypt/letsencrypt.log
|
ln -sf /dev/stdout /var/log/letsencrypt/letsencrypt.log
|
||||||
|
|
||||||
|
|
@ -33,4 +40,6 @@ fi
|
||||||
|
|
||||||
if [ -n "$RENEW_CERTS" ]; then
|
if [ -n "$RENEW_CERTS" ]; then
|
||||||
certbot renew --post-hook "/scripts/certbot_to_haproxy.sh"
|
certbot renew --post-hook "/scripts/certbot_to_haproxy.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm /tmp/certbot-lock
|
||||||
|
|
@ -8,5 +8,4 @@ for CERTIFICATE in `find /etc/letsencrypt/live/* -type d`; do
|
||||||
cat /etc/letsencrypt/live/$CERTIFICATE/fullchain.pem /etc/letsencrypt/live/$CERTIFICATE/privkey.pem > /etc/haproxy/certs/$CERTIFICATE.pem
|
cat /etc/letsencrypt/live/$CERTIFICATE/fullchain.pem /etc/letsencrypt/live/$CERTIFICATE/privkey.pem > /etc/haproxy/certs/$CERTIFICATE.pem
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Reloading certificates... "
|
touch /tmp/force-reload
|
||||||
/usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) &
|
|
||||||
|
|
@ -47,6 +47,14 @@ if [[ ! -z "$1" ]]; then
|
||||||
RELOAD="false"
|
RELOAD="false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
/scripts/certbot.sh
|
||||||
|
|
||||||
|
# If Certbot reloads successfully will create the file /tmp/force-reload
|
||||||
|
if [ -f /tmp/force-reload ]; then
|
||||||
|
RELOAD="true"
|
||||||
|
rm /tmp/force-reload
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$RELOAD" == "true" ]]; then
|
if [[ "$RELOAD" == "true" ]]; then
|
||||||
echo "Reloading..."
|
echo "Reloading..."
|
||||||
/usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) &
|
/usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) &
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue