diff options
author | Starfall <us@starfall.systems> | 2024-01-08 09:40:24 -0600 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2024-01-08 09:40:24 -0600 |
commit | a91d41375fc87c958f0b4b2ec09d5bfa2bab9414 (patch) | |
tree | 5ecf2d3f5b5962bb2d317ad4ce1fddd88e8b0ed7 /noarch/firewall-firewalld |
Diffstat (limited to 'noarch/firewall-firewalld')
-rwxr-xr-x | noarch/firewall-firewalld | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/noarch/firewall-firewalld b/noarch/firewall-firewalld new file mode 100755 index 0000000..5753cc4 --- /dev/null +++ b/noarch/firewall-firewalld @@ -0,0 +1,51 @@ +plug_hifw_firewalld() { +# plug hifw - plug hole in firewall for Fedora 18 +# $1 - port + local FIREWALL_CMD=firewall-cmd + local FIREWALL_OFFLINE_CMD=firewall-offline-cmd + if ! which "$FIREWALL_CMD" ; then + log_message "cannot find file FIREWALL_CMD" + return 1 + fi + + + if "$FIREWALL_CMD" --state ; then + "$FIREWALL_CMD" --permanent --remove-port=${1}/udp + "$FIREWALL_CMD" --remove-port=${1}/udp + else + if ! which "$FIREWALL_OFFLINE_CMD" ; then + log_message "cannot find file FIREWALL_OFFLINE_CMD" + return 1 + else + "$FIREWALL_OFFLINE_CMD" --remove-port=${1}/udp + fi + fi +} + + +make_hifw_firewalld() { +# mhifw - make hole in firewall for Fedora 18 +# $1 - port + local FIREWALL_CMD=firewall-cmd + local FIREWALL_OFFLINE_CMD=firewall-offline-cmd + + plug_hifw_firewalld $1 + + if ! which "$FIREWALL_CMD" ; then + log_message "cannot find file FIREWALL_CMD" + return 1 + fi + + if "$FIREWALL_CMD" --state ; then + "$FIREWALL_CMD" --permanent --add-port=${1}/udp + "$FIREWALL_CMD" --add-port=${1}/udp + else + if ! which "$FIREWALL_OFFLINE_CMD" ; then + log_message "cannot find file FIREWALL_OFFLINE_CMD" + return 1 + else + "$FIREWALL_OFFLINE_CMD" --add-port=${1}/udp + fi + fi +} + |