first commit
This commit is contained in:
57
scripts/IptablesCleanTool.sh
Normal file
57
scripts/IptablesCleanTool.sh
Normal file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
#(c) Roy Cohen 29/11/2012 :roy@wondercohen.nl
|
||||
#objective :IPtables administering tool that cleans duplicate rules
|
||||
#last update :29/11/2012
|
||||
#version :0.1
|
||||
|
||||
# Parameters
|
||||
IPT=/sbin/iptables
|
||||
|
||||
|
||||
function check_duplicate()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function clean_duplicate()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function main()
|
||||
{
|
||||
ROOT_UID=0
|
||||
if [ $UID == $ROOT_UID ];
|
||||
then
|
||||
clear
|
||||
OPT_MAIN=1
|
||||
while [ $OPT_MAIN != 4 ]
|
||||
do
|
||||
echo -e "************************************************************************"
|
||||
#############Check Whether the iptables installed or not############
|
||||
echo -e "\t**********************|Main Menu|***************************\n
|
||||
1. Check for Duplicate Rules\n
|
||||
2. Clean the Duplicate Rules\n
|
||||
3. Save the Iptables\n
|
||||
4. Exit"
|
||||
read OPT_MAIN
|
||||
case $OPT_MAIN in
|
||||
1) check_duplicate ;;
|
||||
2) clean_duplicate ;;
|
||||
3) exit 0 ;;
|
||||
*) echo -e "Wrong option Selected!"
|
||||
esac
|
||||
done
|
||||
else
|
||||
echo -e "You Must be the ROOT to Perfom this Task!"
|
||||
fi
|
||||
}
|
||||
main
|
||||
exit 0
|
Reference in New Issue
Block a user