From df817a0e6e866fe52b2b21c1d9b79ae043a183b7 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Fri, 16 Nov 2018 14:27:29 -0700 Subject: [PATCH] Add firewalld config script. Former-commit-id: fbde2be5bd3a96ccfeeacf406fa8393f37e82277 Former-commit-id: 35ea66a285041685c727dfa5c73f105ab5516396 --- filesystem/etc/skel/bin/.gitignore | 4 --- filesystem/etc/skel/bin/fw | 52 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) delete mode 100644 filesystem/etc/skel/bin/.gitignore create mode 100755 filesystem/etc/skel/bin/fw diff --git a/filesystem/etc/skel/bin/.gitignore b/filesystem/etc/skel/bin/.gitignore deleted file mode 100644 index 5e7d2734..00000000 --- a/filesystem/etc/skel/bin/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/filesystem/etc/skel/bin/fw b/filesystem/etc/skel/bin/fw new file mode 100755 index 00000000..cd2a47fa --- /dev/null +++ b/filesystem/etc/skel/bin/fw @@ -0,0 +1,52 @@ +#!/bin/bash +# init +clear + OPTION=$(whiptail --backtitle "Option Menu" \ + --title "FirewallD Menu" \ + --menu "Make a Selection" 20 65 13 \ + "1." "Firewall Enable........,.. Start firewall on boot" \ + "2." "Firewall Start........,... Start firewall if stopped" \ + "3." "Firewall Stop........,.... Stop firewall" \ + "4." "Firewall Reload........... Reload firewall" \ + "5." "Firewall Status........... Show open services and ports" \ + "6." "Firewall State............ Run status" \ + "7." "Firewall Services......... Show services" \ + "8." "Firewall Open RDP........ Open 3389" \ + "9." "Firewall Open Web Server.. Open http/https" \ + "10." "Firewall Panic On......... ENABLE PANIC MODE" \ + "11." "Firewall Panic Off........ DISABLE PANIC MODE" \ + "12." "Firewall Panic Status..... Check panic mode status" \ + "0." "Exit" 3>&1 1>&2 2>&3) +case "$OPTION" in + 1.) systemctl enable firewalld --now + pause;; + 2.) systemctl start firewalld + pause;; + 3.) systemctl stop firewalld + pause;; + 4.) firewall-cmd --reload + pause;; + 5.) firewall-cmd --list-all + pause;; + 6.) firewall-cmd --state + pause;; + 7.) firewall-cmd --get-services + pause;; + 8.) firewall-cmd --add-port=3389/tcp --permanent + firewall-cmd --reload + pause;; + 9.) firewall-cmd --add-service=http --permanent + firewall-cmd --add-service=https --permanent + firewall-cmd --reload + pause;; + 10.) firewall-cmd --panic-on + firewall-cmd --reload + pause;; + 11.) firewall-cmd --panic-off + firewall-cmd --reload + pause;; + 12.) firewall-cmd --query-panic + pause;; + 0.) exit 0 ;; + esac +fw