From 21097826d4300a9df2b722907bfcadd5758e71c8 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Thu, 29 Feb 2024 11:49:16 +1100 Subject: [PATCH] only update firewall is installed/running --- koji-setup/koji-deploy-hub.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/koji-setup/koji-deploy-hub.sh b/koji-setup/koji-deploy-hub.sh index 188b410..266b952 100644 --- a/koji-setup/koji-deploy-hub.sh +++ b/koji-setup/koji-deploy-hub.sh @@ -301,10 +301,12 @@ cat > /etc/httpd/conf.modules.d/ssl.conf <<- EOF LoadModule ssl_module lib/httpd/modules/mod_ssl.so EOF -# allow httpd access through firewall -firewall-cmd --permanent --add-service=http -firewall-cmd --permanent --add-service=https -firewall-cmd --reload +if firewall-cmd --state >/dev/null 2>&1; then + # allow httpd access through firewall + firewall-cmd --permanent --add-service=http + firewall-cmd --permanent --add-service=https + firewall-cmd --reload +fi # enable and start the httpd service systemctl enable --now httpd