From d41a223285b61c9a7eea7589554c20f1570c36b4 Mon Sep 17 00:00:00 2001 From: Naglfar Date: Sat, 18 Sep 2021 16:45:20 +0200 Subject: [PATCH] Sets how often to save ZNC config file --- roles/shell/files/etc/cron.hourly/znc_saveconfig.sh | 6 ++++++ roles/shell/tasks/znc.yml | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 roles/shell/files/etc/cron.hourly/znc_saveconfig.sh diff --git a/roles/shell/files/etc/cron.hourly/znc_saveconfig.sh b/roles/shell/files/etc/cron.hourly/znc_saveconfig.sh new file mode 100644 index 00000000..42c19ad2 --- /dev/null +++ b/roles/shell/files/etc/cron.hourly/znc_saveconfig.sh @@ -0,0 +1,6 @@ +#!/bin/dash + +PID=$(pgrep -u znc znc) + +#Rewrite znc.conf +[ $PID ] && kill -s USR1 $PID diff --git a/roles/shell/tasks/znc.yml b/roles/shell/tasks/znc.yml index 326075af..b5c6ad76 100644 --- a/roles/shell/tasks/znc.yml +++ b/roles/shell/tasks/znc.yml @@ -56,3 +56,11 @@ allow spoof_all } } + +- name: Rewrite znc.conf + copy: + src: ../files/etc/cron.hourly/znc_saveconfig.sh + dest: /etc/cron.hourly/znc_saveconfig.sh + owner: root + group: znc + mode: 0754