add firewalld open ports hook
This commit is contained in:
parent
23fe96f1a4
commit
217c2094b6
|
@ -5,7 +5,7 @@
|
||||||
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
|
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
|
||||||
|
|
||||||
# List of services to be enabled
|
# List of services to be enabled
|
||||||
services=("nftables" "cockpit" "ssh" "sshguard" "apache2")
|
services=("firewalld" "cockpit" "ssh" "sshguard" "apache2")
|
||||||
|
|
||||||
# Loop to enable each service
|
# Loop to enable each service
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2023 PeppemrintOS Team (peppermintosteam@proton.me)
|
||||||
|
|
||||||
|
# Define the ports you want to open
|
||||||
|
PORTS=("80/tcp" "22/tcp" "9090/tcp" "443/tcp")
|
||||||
|
|
||||||
|
# Check if firewalld is running
|
||||||
|
if systemctl is-active --quiet firewalld; then
|
||||||
|
# Add the specified ports
|
||||||
|
for PORT in "${PORTS[@]}"; do
|
||||||
|
firewall-cmd --add-port="$PORT" --permanent
|
||||||
|
done
|
||||||
|
|
||||||
|
# Reload the firewall rules to apply the changes
|
||||||
|
firewall-cmd --reload
|
||||||
|
fi
|
Loading…
Reference in New Issue