2018-11-16 14:27:29 -07:00
|
|
|
#!/bin/bash
|
|
|
|
# init
|
2019-09-25 14:13:36 -06:00
|
|
|
function pause(){
|
|
|
|
echo 'Press any key to continue...'; read -p "$*"
|
|
|
|
}
|
2018-11-16 14:27:29 -07:00
|
|
|
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" \
|
2019-09-25 14:13:36 -06:00
|
|
|
"7." "Firewall Open RDP......... Open 3389" \
|
|
|
|
"8." "Firewall Open Web Server.. Open http/https" \
|
|
|
|
"9." "Firewall Reset to Default. Close http/https/3389" \
|
2018-11-16 14:27:29 -07:00
|
|
|
"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;;
|
2019-09-25 14:13:36 -06:00
|
|
|
7.) firewall-cmd --add-port=3389/tcp --permanent
|
2018-11-16 14:27:29 -07:00
|
|
|
firewall-cmd --reload
|
|
|
|
pause;;
|
2019-09-25 14:13:36 -06:00
|
|
|
8.) firewall-cmd --add-service=http --permanent
|
2018-11-16 14:27:29 -07:00
|
|
|
firewall-cmd --add-service=https --permanent
|
|
|
|
firewall-cmd --reload
|
|
|
|
pause;;
|
2019-09-25 14:13:36 -06:00
|
|
|
9.) firewall-cmd --remove-service=http --permanent
|
|
|
|
firewall-cmd --remove-service=https --permanent
|
|
|
|
firewall-cmd --remove-port=3389/tcp --permanent
|
|
|
|
firewall-cmd --reload
|
|
|
|
pause;;
|
2018-11-16 14:27:29 -07:00
|
|
|
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
|