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
672fc9ad
Commit
672fc9ad
authored
Oct 12, 2019
by
Ruzal Gimazov
Committed by
Ruzal Gimazov
Nov 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed
parent
c8fbe0d6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
eterban.conf
prod-server/etc/eterban/eterban.conf
+1
-1
eterban.service
prod-server/etc/systemd/system/eterban.service
+9
-0
ban.py
prod-server/usr/share/eterban/ban.py
+10
-2
No files found.
prod-server/etc/eterban/eterban.conf
View file @
672fc9ad
host_redis
=
1
92
.
168
.
101
.
101
host_redis
=
1
0
.
20
.
30
.
101
prod-server/etc/systemd/system/eterban.service
0 → 100644
View file @
672fc9ad
[Unit]
Description= Start ban.py
[Service]
ExecStart=/usr/share/eterban/ban.py
[Install]
WantedBy=multi-user.target
\ No newline at end of file
prod-server/usr/share/eterban/ban.py
View file @
672fc9ad
...
...
@@ -5,9 +5,16 @@ f = open ('/etc/eterban/eterban.conf','r')
line
=
f
.
readline
()
f
.
close
()
if
line
[:
10
]
==
"host_redis"
:
i
=
10
while
(
line
[
i
]
==
' '
):
i
+=
1
i
+=
1
while
(
line
[
i
]
==
' '
):
i
+=
1
if
line
[
-
1
]
==
'
\n
'
:
host_redis
=
line
[
-
16
:
-
1
]
host_redis
=
line
[
i
:
-
1
]
else
:
host_redis
=
line
[
-
15
:]
host_redis
=
line
[
i
:]
r
=
redis
.
Redis
(
host
=
host_redis
)
r
.
publish
(
'ban'
,
sys
.
argv
[
1
])
\ No newline at end of file
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