Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
6e33f51c
Commit
6e33f51c
authored
Mar 15, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ipfs_z-i scripts to priv
parent
281c159f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
get_ips_z-i.sh
router/get_ips_z-i.sh
+4
-3
update_z-i.sh
router/update_z-i.sh
+18
-4
No files found.
router/get_ips_z-i.sh
View file @
6e33f51c
#!/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'
router/update_z-i.sh
View file @
6e33f51c
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment