firewall/modules/module-menu.sh

58 lines
1.8 KiB
Bash
Raw Normal View History

2024-09-24 22:58:37 -06:00
#!/bin/bash
FIREWALL="/opt/firewall/firewall.sh"
MENU_TOP="=============================FireWall================================="
MENU_BOTTOM="====================================================================="
menu() {
clear
echo
echo $MENU_TOP
echo "1. Start"
echo "2. Stop"
echo "3. Reseearch"
echo "4. Forgive"
echo "5. Status"
echo "6. EMPTY"
echo "7. Test Bot Search Rules"
echo "8. Research IP"
echo "9. View Current Rule Set"
echo "0. Quit"
echo $MENU_BOTTOM
echo
read -p 'Choice: ' CHOICE
echo
if [ "$CHOICE" = "1" ]; then
echo
echo "Starting Firewall"
bash $FIREWALL start
read -p 'Press Enter to Continue ' -e-
elif [ "$CHOICE" = "2" ]; then
echo
echo "Stopping Firewall"
bash $FIREWALL stop
read -p 'Press Enter to Continue ' -e
elif [ "$CHOICE" = "3" ]; then
bash $FIREWALL research
read -p 'Press Enter to Continue ' -e
elif [ "$CHOICE" = "4" ]; then
bash $FIREWALL forgive
elif [ "$CHOICE" = "5" ]; then
bash $FIREWALL status
read -p 'Press Enter to Continue ' -e
elif [ "$CHOICE" = "7" ]; then
bash $FIREWALL test-bots
read -p 'Press Enter to Continue ' -e
elif [ "$CHOICE" = "8" ]; then
bash $FIREWALL research-ip
read -p 'Press Enter to Continue ' -e
elif [ "$CHOICE" = "9" ]; then
nft -s list ruleset | less
elif [ "$CHOICE" = "0" ]; then
exit
fi
echo
menu
}
menu