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
a77ab811
Commit
a77ab811
authored
Oct 09, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add z-i scripts
parent
74141e25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
get_ips_z-i.sh
router/get_ips_z-i.sh
+5
-0
update_z-i.sh
router/update_z-i.sh
+24
-0
No files found.
router/get_ips_z-i.sh
0 → 100755
View file @
a77ab811
#!/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'
router/update_z-i.sh
0 → 100755
View file @
a77ab811
#!/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
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