Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterban
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eterban
Commits
0bd9aa5b
Commit
0bd9aa5b
authored
Oct 23, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add IPv6 support
parent
f3da27cf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
15 deletions
+100
-15
eterban.sh
gateway/usr/bin/eterban.sh
+5
-0
eterban_switcher.py
gateway/usr/share/eterban/eterban_switcher.py
+95
-15
No files found.
gateway/usr/bin/eterban.sh
View file @
0bd9aa5b
#!/bin/sh
setname
=
"eterban_1"
setname_ipv6
=
"eterban_1_ipv6"
command
=
"
$1
"
[
-n
"
$command
"
]
&&
shift
if
[
"
$command
"
=
"count"
]
;
then
echo
"Count of banned:"
# TODO: some quiet to ignore headers
ipset list
$setname
|
wc
-l
ipset list
$setname_ipv6
|
wc
-l
exit
fi
if
[
"
$command
"
=
"list"
]
;
then
ipset list
$setname
ipset list
$setname_ipv6
exit
fi
...
...
@@ -29,6 +33,7 @@ fi
if
[
"
$command
"
=
"search"
]
;
then
mask
=
"
$(
echo
"
$1
"
|
sed
-e
's|\.|\\.|g'
)
"
ipset list
$setname
|
grep
--color
"
$mask
"
ipset list
$setname_ipv6
|
grep
--color
"
$mask
"
exit
fi
...
...
gateway/usr/share/eterban/eterban_switcher.py
View file @
0bd9aa5b
This diff is collapsed.
Click to expand it.
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