Commit a77ab811 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add z-i scripts

parent 74141e25
#!/bin/sh
cd /home/lav/z-i || exit
git pull
#cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sort -u
cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sort -u|sed '$d'
#!/bin/sh
cd $(dirname $0) || exit
SETNAME=rkz
ipset destroy $SETNAME.tmp || exit
ipset create $SETNAME.tmp hash:ip || exit
#ip rule show | grep "lookup openroute" | sed -e "s|.*:||g" | sed -e "s|lookup|table|g" | while read str ; do
#done
./get_ips_z-i.sh | while read ip ; do
#ip rule add to $ip table openroute
ipset add $SETNAME.tmp $ip
done
ipset list $SETNAME.tmp | wc -l >$0.count
ipset swap $SETNAME.tmp $SETNAME
# initial
if ! iptables -L -t mangle | grep -q $SETNAME ; then
iptables -t mangle -A PREROUTING -m set --match-set $SETNAME dst -j MARK --set-mark 5
ip rule add fwmark 5 table openroute
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment