mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[deb] Move yunohost-firewall restart to a separate and improved function
This commit is contained in:
parent
b6ee72e412
commit
b1abc6f7e8
1 changed files with 27 additions and 10 deletions
37
debian/postinst
vendored
37
debian/postinst
vendored
|
@ -15,22 +15,39 @@ do_configure() {
|
|||
yunohost service regenconf
|
||||
|
||||
# restart yunohost-firewall if it's running
|
||||
if service yunohost-firewall status >/dev/null; then
|
||||
update-rc.d yunohost-firewall defaults >/dev/null
|
||||
[ -d /run/systemd/system ] \
|
||||
&& systemctl --system daemon-reload >/dev/null || true
|
||||
echo "Restarting yunohost-firewall..."
|
||||
invoke-rc.d yunohost-firewall restart || true
|
||||
else
|
||||
echo "Service yunohost-firewall is not running, you should " \
|
||||
"consider to start it by doing 'service yunohost-firewall start'."
|
||||
fi
|
||||
service yunohost-firewall status >/dev/null \
|
||||
&& restart_yunohost_firewall \
|
||||
|| echo "Service yunohost-firewall is not running, you should " \
|
||||
"consider to start it by doing 'service yunohost-firewall start'."
|
||||
fi
|
||||
|
||||
# update PAM configs
|
||||
pam-auth-update --package
|
||||
}
|
||||
|
||||
restart_yunohost_firewall() {
|
||||
echo "Restarting YunoHost firewall..."
|
||||
|
||||
if [ -x /etc/init.d/yunohost-firewall ]; then
|
||||
update-rc.d yunohost-firewall defaults >/dev/null || true
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
else
|
||||
invoke-rc.d yunohost-firewall start >/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
deb-systemd-helper unmask yunohost-firewall.service >/dev/null || true
|
||||
if deb-systemd-helper --quiet was-enabled yunohost-firewall.service; then
|
||||
deb-systemd-helper enable yunohost-firewall.service >/dev/null || true
|
||||
fi
|
||||
deb-systemd-helper update-state yunohost-firewall.service >/dev/null || true
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke try-restart yunohost-firewall.service >/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postinst> `configure' <most-recently-configured-version>
|
||||
# * <old-postinst> `abort-upgrade' <new version>
|
||||
|
|
Loading…
Add table
Reference in a new issue