Commit 6e33f51c authored by Vitaly Lipatov's avatar Vitaly Lipatov

update ipfs_z-i scripts to priv

parent 281c159f
#!/bin/sh
cd /home/lav/z-i || exit
git pull >/dev/null
#cd /home/lav/z-i || exit
#git pull >/dev/null
#cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sort -u
cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sed '1d'|sort -u
#cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sed '1d'|sort -u
curl http://reestr.rublacklist.net/api/ips | sed -e 's|"||g' | sed -e 's|;|\n|g'
#!/bin/sh
cd $(dirname $0) || exit
cd $(dirname "$(readlink "$0")") || exit #"
SETNAME=rkz
IFACE=breth0
if [ "$1" = "--show" ] ; then
echo "iptables -t mangle -A PREROUTING -i $IFACE -m set --match-set $SETNAME dst -j MARK --set-mark 5"
exit
fi
ipset destroy $SETNAME.tmp
ipset create $SETNAME hash:ip 2>/dev/null
ipset create $SETNAME.tmp hash:ip || exit
......@@ -10,8 +17,9 @@ 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
ssh -q 192.168.1.217 -l xoxo| grep -v "Last login"| sed $'s/\r//' | while read ip ; do
#./get_ips_z-i.sh |while read ip ; do
#ssh -q 192.168.1.217 -l xoxo| grep -v "Last login"| sed $'s/\r//' | while read ip ; do
#./get_ips_z-i.sh | while read ip ; do
cat z | while read ip ; do
#ip rule add to $ip table openroute
ipset add $SETNAME.tmp $ip
done
......@@ -21,7 +29,13 @@ ipset swap $SETNAME.tmp $SETNAME
# initial
if ! iptables -L -t mangle | grep -q $SETNAME ; then
iptables -t mangle -A PREROUTING -i $IFACE -m set --match-set $SETNAME dst -j MARK --set-mark 5 || exit
fi
if ! ip route show table openroute | grep -q "default dev tun0" ; then
ip route replace default table openroute scope global nexthop dev tun0 || exit
iptables -t mangle -A PREROUTING -i our -m set --match-set $SETNAME dst -j MARK --set-mark 5 || exit
fi
if ! ip rule | grep -q "fwmark 0x5" ; then
ip rule add fwmark 5 table openroute || exit
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