Diff for scripts/shell/firewall/fw-universal.sh between version 2.72 and 2.74
version 2.72, 2010/06/09 11:29:14 |
version 2.74, 2010/08/08 23:34:25 |
|
|
#!/bin/sh |
#!/bin/bash |
|
|
# |
# |
# This will be universal firewalling script for Linux kernel (iptables) in near future |
# This will be universal firewalling script for Linux kernel (iptables) in near future |
|
|
# Licensed under terms of GNU General Public License. |
# Licensed under terms of GNU General Public License. |
# All rights reserved. |
# All rights reserved. |
# |
# |
# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.71 2009-11-06 23:14:36 nepto Exp $ |
# $Platon: scripts/shell/firewall/fw-universal.sh,v 2.73 2010-06-21 21:52:16 nepto Exp $ |
# |
# |
# Changelog: |
# Changelog: |
# 2003-10-24 - created |
# 2003-10-24 - created |
Line 1025 configure_special_rules() |
|
Line 1025 configure_special_rules() |
|
|
|
} # }}} |
} # }}} |
|
|
|
custom_rules() |
|
{ # {{{ |
|
print_info -en "Executing custom rules: " |
|
for max_rule_num in 9 99 999; do |
|
initialized="no"; |
|
for i in `seq -w 0 "$max_rule_num"`; do |
|
varname="CUSTOM_RULE_$i"; |
|
if [ -z "${!varname}" ]; then |
|
break; |
|
fi |
|
echo -n "#$i"; |
|
$IPTABLES ${!varname}; |
|
rc="$?"; |
|
if [ "$rc" -eq 0 ]; then |
|
echo -n "[OK] "; |
|
else |
|
echo -n "[rc:$?] "; |
|
fi; |
|
initialized="yes"; |
|
done |
|
if [ "X$initialized" = "Xyes" ]; then |
|
break; |
|
fi |
|
done |
|
print_info " done."; |
|
} # }}} |
|
|
do_ip_accounting() |
do_ip_accounting() |
{ # {{{ |
{ # {{{ |
|
|
|
|
shaping_off |
shaping_off |
shaping_on |
shaping_on |
configure_special_rules |
configure_special_rules |
|
custom_rules |
$IPTABLES_SAVE -c > $CACHE_FILE |
$IPTABLES_SAVE -c > $CACHE_FILE |
;; |
;; |
|
|
Platon Group <platon@platon.org> http://platon.org/
|
|