|
@@ -75,6 +75,10 @@ do_not_log_action () {
|
|
|
return 0
|
|
return 0
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+translate_iptables_rule(){
|
|
|
|
|
+ echo $* | sed -e 's/'$IPTABLES_ADD'/-A/g' -e 's/'$IPTABLES_INSERT'/-I/g' -e 's/'$IPTABLES_SET_POLICY'/-P/g'
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
###############################################################
|
|
###############################################################
|
|
|
# Firewall actions function definition
|
|
# Firewall actions function definition
|
|
|
###############################################################
|
|
###############################################################
|
|
@@ -139,17 +143,20 @@ do_exec () {
|
|
|
echo "Nothing to be done for $1"
|
|
echo "Nothing to be done for $1"
|
|
|
;;
|
|
;;
|
|
|
esac
|
|
esac
|
|
|
- if [ ${verbose} -ge 1 ] ; then
|
|
|
|
|
- echo $IP_TABLES $it_table $it_option $it_command
|
|
|
|
|
- fi
|
|
|
|
|
if ! $IP_TABLES $it_table -C $it_command > /dev/null 2>&1
|
|
if ! $IP_TABLES $it_table -C $it_command > /dev/null 2>&1
|
|
|
then
|
|
then
|
|
|
|
|
+ if [ ${verbose} -ge 1 ] ; then
|
|
|
|
|
+ echo $IP_TABLES $it_table $it_option $it_command
|
|
|
|
|
+ fi
|
|
|
$IP_TABLES $it_table $it_option $it_command
|
|
$IP_TABLES $it_table $it_option $it_command
|
|
|
fi
|
|
fi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
do_check () {
|
|
do_check () {
|
|
|
|
|
+ if [ ${verbose} -ge 1 ] ; then
|
|
|
|
|
+ echo "do_check params='$*'"
|
|
|
|
|
+ fi
|
|
|
local it_action=`get_action_information $*`
|
|
local it_action=`get_action_information $*`
|
|
|
local it_table=`get_table_information $*`
|
|
local it_table=`get_table_information $*`
|
|
|
local it_command=`get_command_information $*`
|
|
local it_command=`get_command_information $*`
|
|
@@ -170,11 +177,14 @@ do_check () {
|
|
|
esac
|
|
esac
|
|
|
default_option=-C
|
|
default_option=-C
|
|
|
if [ ${verbose} -ge 1 ] ; then
|
|
if [ ${verbose} -ge 1 ] ; then
|
|
|
|
|
+ echo "it_action=$it_action"
|
|
|
|
|
+ echo "it_table=$it_table"
|
|
|
|
|
+ echo "it_command=$it_command"
|
|
|
echo $do_log "$it_action:" $IP_TABLES $it_table -C $it_command
|
|
echo $do_log "$it_action:" $IP_TABLES $it_table -C $it_command
|
|
|
echo $IP_TABLES $it_table -C $it_command
|
|
echo $IP_TABLES $it_table -C $it_command
|
|
|
fi
|
|
fi
|
|
|
- $do_log "$it_action:" $IP_TABLES -C $it_command
|
|
|
|
|
- $IP_TABLES $it_table -C $it_command
|
|
|
|
|
|
|
+ $do_log "$it_action:" $IP_TABLES $it_table -C $it_command
|
|
|
|
|
+ $IP_TABLES $it_table -C $it_command
|
|
|
global_status=$((global_status+$?))
|
|
global_status=$((global_status+$?))
|
|
|
}
|
|
}
|
|
|
|
|
|