aboutsummaryrefslogtreecommitdiffstats
path: root/roles/web/files/acme/deploy.sh
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-05 19:27:06 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commitd9b877957c52789e494aeee1ffd4d3128dd9e597 (patch)
treea1ad213d957d789473b4de2a444efc6ee5a47cc2 /roles/web/files/acme/deploy.sh
parentde51948fd19f05dbeb4eb5ea0cfd6bc46713abd1 (diff)
downloadansible-dfly-vps-d9b877957c52789e494aeee1ffd4d3128dd9e597.tar.bz2
web: create files/{acme,nginx} to organize files better
Diffstat (limited to 'roles/web/files/acme/deploy.sh')
-rwxr-xr-xroles/web/files/acme/deploy.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/web/files/acme/deploy.sh b/roles/web/files/acme/deploy.sh
new file mode 100755
index 0000000..9c6fff2
--- /dev/null
+++ b/roles/web/files/acme/deploy.sh
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+#
+# Restart the services after renewing the certificate(s) to deploy the
+# changed certificate(s).
+#
+# This script will be weekly executed. See "/etc/periodic.conf".
+#
+# Aaron LI
+#
+
+# Services to be restarted after ACME certificate update
+SERVICES="nginx dovecot postfix"
+
+for srv in ${SERVICES}; do
+ if service ${srv} status >/dev/null 2>&1; then
+ echo "ACME deploy: restarting ${srv} ..."
+ service ${srv} restart
+ else
+ echo "ACME deploy: service ${srv} not running"
+ fi
+done