mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Don't try restarting metronome if no domain configured for it
This commit is contained in:
parent
daa9eb1cab
commit
452ba8bb9a
1 changed files with 5 additions and 4 deletions
|
@ -20,7 +20,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import glob
|
from glob import glob
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -734,10 +734,11 @@ def _enable_certificate(domain, new_cert_folder):
|
||||||
logger.debug("Restarting services...")
|
logger.debug("Restarting services...")
|
||||||
|
|
||||||
for service in ("dovecot", "metronome"):
|
for service in ("dovecot", "metronome"):
|
||||||
# Ugly trick to not restart metronome if it's not installed
|
# Ugly trick to not restart metronome if it's not installed or no domain configured for XMPP
|
||||||
if (
|
if (
|
||||||
service == "metronome"
|
service == "metronome"
|
||||||
and os.system("dpkg --list | grep -q 'ii *metronome'") != 0
|
and (os.system("dpkg --list | grep -q 'ii *metronome'") != 0
|
||||||
|
or not glob("/etc/metronome/conf.d/*.cfg.lua"))
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
_run_service_command("restart", service)
|
_run_service_command("restart", service)
|
||||||
|
@ -853,7 +854,7 @@ def _regen_dnsmasq_if_needed():
|
||||||
do_regen = False
|
do_regen = False
|
||||||
|
|
||||||
# For all domain files in DNSmasq conf...
|
# For all domain files in DNSmasq conf...
|
||||||
domainsconf = glob.glob("/etc/dnsmasq.d/*.*")
|
domainsconf = glob("/etc/dnsmasq.d/*.*")
|
||||||
for domainconf in domainsconf:
|
for domainconf in domainsconf:
|
||||||
# Look for the IP, it's in the lines with this format :
|
# Look for the IP, it's in the lines with this format :
|
||||||
# host-record=the.domain.tld,11.22.33.44
|
# host-record=the.domain.tld,11.22.33.44
|
||||||
|
|
Loading…
Add table
Reference in a new issue