From aed916dc76f5cf71b872d76a25083fd27af90b3d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 15 Mar 2018 09:10:49 +0800 Subject: znc: move data dir to /home/znc, listen on ipv4 & ipv6, fix reload --- roles/znc/templates/acme/znc.j2 | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'roles/znc/templates/acme') 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 -- cgit v1.2.2