Added clear command

This commit is contained in:
madmaurice 2015-08-11 11:12:52 +02:00
parent cd7ef7da2b
commit 0d46467a6c

View file

@ -67,6 +67,14 @@ do_list() {
ls $PROFILES | egrep '.rules$' | sed 's/.rules$//g'
}
do_clear() {
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
echo "Clearing iptables succeeded."
}
if [ "$1" == "-h" -o "$1" == "help" ]; then
cat <<EOF
@ -76,6 +84,7 @@ Commands:
- load
- save
- list
- clear
EOF
exit
fi
@ -95,5 +104,11 @@ case $1 in
list)
do_list
;;
clear)
do_clear
;;
*)
echo "Unknown command $1. try help"
;;
esac