Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # -- UTF 8 --
- # Simple script to manage iptables
- # Un script simple para gestionar iptables
- OPTIONS="Exit See Edit Launch Save Enable"
- select opt in $OPTIONS; do
- if [ "$opt" = "Exit" ]; then
- echo done
- exit
- #2
- elif [ "$opt" = "See" ]; then
- echo "Te voy a mostrar las reglas que están vigentes"
- iptables -nvL
- #3
- elif [ "$opt" = "Edit" ]; then
- echo "Editando el script que gestiona iptables"
- kdesu kate /home/user/ruta_al_script.sh
- #4
- elif [ "$opt" = "Launch" ]; then
- echo "Ejecutando el script que gestiona iptables"
- sh /home/user/ruta_al_script.sh
- #5
- elif [ "$opt" = "Save" ]; then
- echo "Guardando las reglas actuales para próximos reinicios"
- # Descomentar lo que corresponda o editar según necesidades
- # En Arch sería:
- # iptables-save > /etc/iptables/iptables.rules
- # En Debian sería:
- # iptables-save > /etc/iptables.up.rules
- #6
- elif [ "$opt" = "Enable" ]; then
- echo "Activando el servicio iptables"
- # En Arch:
- systemctl enable iptables && systemctl start iptables
- else
- clear
- echo bad option
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement