Commit 672fc9ad authored by Ruzal Gimazov's avatar Ruzal Gimazov Committed by Ruzal Gimazov

Bug fixed

parent c8fbe0d6
host_redis = 192.168.101.101
host_redis = 10.20.30.101
[Unit]
Description= Start ban.py
[Service]
ExecStart=/usr/share/eterban/ban.py
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -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
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