mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
metronome: Auto-enable/disable metronome if there's no/at least one domain configured for XMPP
This commit is contained in:
parent
456b8857ef
commit
c990cee630
2 changed files with 20 additions and 2 deletions
|
@ -74,8 +74,22 @@ do_post_regen() {
|
||||||
chown -R metronome: /var/lib/metronome/
|
chown -R metronome: /var/lib/metronome/
|
||||||
chown -R metronome: /etc/metronome/conf.d/
|
chown -R metronome: /etc/metronome/conf.d/
|
||||||
|
|
||||||
|
if [[ -z "$(ls /etc/metronome/conf.d/*.cfg.lua 2>/dev/null)" ]]
|
||||||
|
then
|
||||||
|
if systemctl is-enabled metronome &>/dev/null
|
||||||
|
then
|
||||||
|
systemctl disable metronome --now 2>/dev/null
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! systemctl is-enabled metronome &>/dev/null
|
||||||
|
then
|
||||||
|
systemctl enable metronome --now 2>/dev/null
|
||||||
|
sleep 3
|
||||||
|
fi
|
||||||
|
|
||||||
[[ -z "$regen_conf_files" ]] \
|
[[ -z "$regen_conf_files" ]] \
|
||||||
|| systemctl restart metronome
|
|| systemctl restart metronome
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_$1_regen ${@:2}
|
do_$1_regen ${@:2}
|
||||||
|
|
|
@ -712,6 +712,10 @@ def _get_services():
|
||||||
"category": "web",
|
"category": "web",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ignore metronome entirely if XMPP was disabled on all domains
|
||||||
|
if "metronome" in services and not glob("/etc/metronome/conf.d/*.cfg.lua"):
|
||||||
|
del services["metronome"]
|
||||||
|
|
||||||
# Remove legacy /var/log/daemon.log and /var/log/syslog from log entries
|
# Remove legacy /var/log/daemon.log and /var/log/syslog from log entries
|
||||||
# because they are too general. Instead, now the journalctl log is
|
# because they are too general. Instead, now the journalctl log is
|
||||||
# returned by default which is more relevant.
|
# returned by default which is more relevant.
|
||||||
|
|
Loading…
Add table
Reference in a new issue