sbin/mbse-firewall

changeset 6
be2d7c142726
parent 5
2340826a516b
child 7
c846ebedfff3
equal deleted inserted replaced
5:2340826a516b 6:be2d7c142726
20 # You should have received a copy of the GNU General Public License 20 # You should have received a copy of the GNU General Public License
21 # along with this program; see the file COPYING. If not, write to the Free 21 # along with this program; see the file COPYING. If not, write to the Free
22 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 22 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 # --------------------------------------------------------------------------- 23 # ---------------------------------------------------------------------------
24 24
25 MBSEFW_VERSION="0.0.16" 25 MBSEFW_VERSION="0.0.17"
26 26
27 # Sanity checks 27 # Sanity checks
28 if [ "$(id -u)" != "0" ]; then 28 if [ "$(id -u)" != "0" ]; then
29 echo "** You must be root to run this program" 29 echo "** You must be root to run this program"
30 exit 1 30 exit 1
154 HOST="$(hostname)" 154 HOST="$(hostname)"
155 155
156 if [ -f $BLOCKLIST ]; then 156 if [ -f $BLOCKLIST ]; then
157 echo "Reload $BLOCKLIST" | $LOGGER 157 echo "Reload $BLOCKLIST" | $LOGGER
158 $IPSET create ${HOST}-new-mbsefw-blk4ip hash:ip counters -exist 158 $IPSET create ${HOST}-new-mbsefw-blk4ip hash:ip counters -exist
159 $IPSET create ${HOST}new-mbsefw-blk4net hash:net counters -exist 159 $IPSET create ${HOST}-new-mbsefw-blk4net hash:net counters -exist
160 $GREP -Ev '^#|^;|^\s*$' $BLOCKLIST | while read L ; do 160 $GREP -Ev '^#|^;|^\s*$' $BLOCKLIST | while read L ; do
161 set $L 161 set $L
162 if echo $1 | $GREP -q "/" ; then 162 if echo $1 | $GREP -q "/" ; then
163 $IPSET add ${HOST}-new-mbsefw-blk4net $1 -exist 163 $IPSET add ${HOST}-new-mbsefw-blk4net $1 -exist
164 else 164 else

mercurial