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' 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 if [ "$1" == "-h" -o "$1" == "help" ]; then
cat <<EOF cat <<EOF
@ -76,6 +84,7 @@ Commands:
- load - load
- save - save
- list - list
- clear
EOF EOF
exit exit
fi fi
@ -95,5 +104,11 @@ case $1 in
list) list)
do_list do_list
;; ;;
clear)
do_clear
;;
*)
echo "Unknown command $1. try help"
;;
esac esac