Commit 0f4f5953 authored by Ruzal Gimazov's avatar Ruzal Gimazov

Извенение имени конфига

parent eae7d4fc
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import redis import redis
import subprocess import subprocess
f = open ('/etc/eterban/eterban_swicher.conf','r') f = open ('/etc/eterban/eterban.conf','r')
line = f.readline() line = f.readline()
f.close() f.close()
if line[:10] == "host_redis": if line[:10] == "host_redis":
......
#!/usr/bin/python3 #!/usr/bin/python3
mport sys, radom, redis import sys, redis
host_redis = '192.168.101.101'
f = open ('/etc/eterban/eterban.conf','r')
line = f.readline()
f.close()
if line[:10] == "host_redis":
if line[-1] == '\n':
host_redis = line[-16:-1]
else:
host_redis = line[-15:]
r = redis.Redis (host=host_redis) r = redis.Redis (host=host_redis)
r.publish ('ban', sys.argv[1]) r.publish ('ban', sys.argv[1])
\ No newline at end of file
host_redis = 192.168.101.101
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