aboutsummaryrefslogtreecommitdiffstats
path: root/roles/znc/templates/acme/znc.j2
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-15 09:10:49 +0800
committerAaron LI <aly@aaronly.me>2018-03-15 09:10:49 +0800
commitaed916dc76f5cf71b872d76a25083fd27af90b3d (patch)
treea9de8c41fec0946defa2a706cf8c6de45818a4dc /roles/znc/templates/acme/znc.j2
parentf2402b66976e57c457b36141444a3687ce918bfe (diff)
downloadansible-dfly-vps-aed916dc76f5cf71b872d76a25083fd27af90b3d.tar.bz2
znc: move data dir to /home/znc, listen on ipv4 & ipv6, fix reload
Diffstat (limited to 'roles/znc/templates/acme/znc.j2')
-rw-r--r--roles/znc/templates/acme/znc.j222
1 files changed, 14 insertions, 8 deletions
diff --git a/roles/znc/templates/acme/znc.j2 b/roles/znc/templates/acme/znc.j2
index de849b7..0be5dc0 100644
--- a/roles/znc/templates/acme/znc.j2
+++ b/roles/znc/templates/acme/znc.j2
@@ -7,11 +7,11 @@
# ZNC supports SSLKeyFile and SSLDHParamFile since v1.7
#
#cp -v /usr/local/etc/ssl/acme/private/{{ network.domain }}.pem \
-# /usr/local/etc/znc/znc.ssl.key
+# {{ znc.data_dir }}/znc.ssl.key
#cp -v /usr/local/etc/ssl/acme/{{ network.domain }}/fullchain.pem \
-# /usr/local/etc/znc/znc.ssl.crt
-#chown znc:znc /usr/local/etc/znc/znc.ssl.key /usr/local/etc/znc/znc.ssl.crt
-#chmod 0400 /usr/local/etc/znc/znc.ssl.key /usr/local/etc/znc/znc.ssl.crt
+# {{ znc.data_dir }}/znc.ssl.crt
+#chown znc:znc {{ znc.data_dir }}/znc.ssl.key {{ znc.data_dir }}/znc.ssl.crt
+#chmod 0400 {{ znc.data_dir }}/znc.ssl.key {{ znc.data_dir }}/znc.ssl.crt
# SSL: https://wiki.znc.in/Signed_SSL_certificate
# Everything in a single file, in the order from the most *private* to
@@ -21,8 +21,14 @@
cat /usr/local/etc/ssl/acme/private/{{ network.domain }}.pem \
/usr/local/etc/ssl/acme/{{ network.domain }}/fullchain.pem \
/usr/local/etc/ssl/dhparam4096.pem \
- > /usr/local/etc/znc/znc.allinone.pem
-chown znc:znc /usr/local/etc/znc/znc.allinone.pem
-chmod 0400 /usr/local/etc/znc/znc.allinone.pem
+ > {{ znc.data_dir }}/znc.allinone.pem
+chown znc:znc {{ znc.data_dir }}/znc.allinone.pem
+chmod 0400 {{ znc.data_dir }}/znc.allinone.pem
-reload znc
+if pgrep -x znc >/dev/null; then
+ echo "Reloading service znc: ..."
+ killall -SIGHUP znc
+ echo "ok"
+else
+ echo "WARNING: service znc is not running" >&2
+fi