test: More precise firewall configuration

Only enable cockpit in the firewall if it is actually running, not
merely installed.
This commit is contained in:
Martin Pitt 2024-03-16 09:14:30 +01:00 committed by Allison Karlitskaya
parent 84608a1680
commit 7b1315a3ca

View file

@ -7,7 +7,7 @@ set -eux
mkdir -p /etc/cockpit
printf "[WebService]\\nAllowUnencrypted=true\\n" > /etc/cockpit/cockpit.conf
if type firewall-cmd >/dev/null 2>&1; then
if systemctl is-active -q firewalld.service; then
firewall-cmd --add-service=cockpit --permanent
fi
systemctl enable cockpit.socket