Added clear command
This commit is contained in:
parent
cd7ef7da2b
commit
0d46467a6c
1 changed files with 15 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue