Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- f_ban () {
- echo "Enter IP Address to Ban: "
- read address
- sudo iptables -I INPUT -s $address -j DROP
- sudo sh -c "iptables-save > /etc/iptables.rules"
- echo "IP Ban Complete."
- echo "Kick Player to finish Process"
- sleep 1
- }
- f_show () {
- sudo iptables -L INPUT -n --line-numbers
- echo "Delete Record? (Y/N)"
- read choice
- if [ $choice = "y" -o $choice = "Y" ]; then
- echo "Enter Record to Drop"
- read addrdrop
- sudo iptables -D INPUT $addrdrop
- sudo sh -c "iptables-save > /etc/iptables.rules"
- fi
- }
- while : # Loop forever
- do
- cat << !
- ========= IP TABLES BAN IP MENU ==========
- 1. Ban IP
- 2. Show / Modify Banned IPS
- 3. Quit
- !
- echo -n " Your choice? : "
- read choice
- case $choice in
- 1) f_ban ;;
- 2) f_show ;;
- 3) exit ;;
- *) echo "\"$choice\" is not valid "; sleep 2 ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement