mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] Use proper functions to enable/start firewall during postinstall
This commit is contained in:
parent
b560207423
commit
fd23216544
2 changed files with 4 additions and 4 deletions
|
@ -506,7 +506,7 @@ def _run_service_command(action, service):
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unknown action '%s'" % action)
|
raise ValueError("Unknown action '%s'" % action)
|
||||||
|
|
||||||
need_lock = (services[service].get('need_lock') or False) \
|
need_lock = services[service].get('need_lock', False) \
|
||||||
and action in ['start', 'stop', 'restart', 'reload']
|
and action in ['start', 'stop', 'restart', 'reload']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -47,7 +47,7 @@ from yunohost.app import app_fetchlist, app_info, app_upgrade, app_ssowatconf, a
|
||||||
from yunohost.domain import domain_add, domain_list, get_public_ip, _get_maindomain, _set_maindomain
|
from yunohost.domain import domain_add, domain_list, get_public_ip, _get_maindomain, _set_maindomain
|
||||||
from yunohost.dyndns import _dyndns_available, _dyndns_provides
|
from yunohost.dyndns import _dyndns_available, _dyndns_provides
|
||||||
from yunohost.firewall import firewall_upnp
|
from yunohost.firewall import firewall_upnp
|
||||||
from yunohost.service import service_status, service_regen_conf, service_log
|
from yunohost.service import service_status, service_regen_conf, service_log, service_start, service_enable
|
||||||
from yunohost.monitor import monitor_disk, monitor_system
|
from yunohost.monitor import monitor_disk, monitor_system
|
||||||
from yunohost.utils.packages import ynh_packages_version
|
from yunohost.utils.packages import ynh_packages_version
|
||||||
|
|
||||||
|
@ -398,8 +398,8 @@ def tools_postinstall(domain, password, ignore_dyndns=False):
|
||||||
os.system('touch /etc/yunohost/installed')
|
os.system('touch /etc/yunohost/installed')
|
||||||
|
|
||||||
# Enable and start YunoHost firewall at boot time
|
# Enable and start YunoHost firewall at boot time
|
||||||
os.system('update-rc.d yunohost-firewall enable')
|
service_enable("yunohost-firewall")
|
||||||
os.system('service yunohost-firewall start &')
|
service_start("yunohost-firewall")
|
||||||
|
|
||||||
service_regen_conf(force=True)
|
service_regen_conf(force=True)
|
||||||
logger.success(m18n.n('yunohost_configured'))
|
logger.success(m18n.n('yunohost_configured'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue