change piep for replaces
This commit is contained in:
parent
2f7feb216d
commit
41618bf385
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ class SmtpdWatcher:
|
||||||
def _read_banned_ips(self):
|
def _read_banned_ips(self):
|
||||||
ips = {}
|
ips = {}
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['/usr/bin/fail2ban-client', 'get', 'postfix', 'banned', '|', 'tr', '-d', '"][\',"'],
|
['/usr/bin/fail2ban-client', 'get', 'postfix', 'banned'],
|
||||||
encoding='utf-8',
|
encoding='utf-8',
|
||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
|
@ -60,7 +60,7 @@ class SmtpdWatcher:
|
||||||
result.returncode,
|
result.returncode,
|
||||||
result.stderr,
|
result.stderr,
|
||||||
)
|
)
|
||||||
ips['postfix'] = result.stdout.split(' ')
|
ips['postfix'] = result.stdout.replace("'", '').replace(',', '').replace(']', '').replace('[', '').split(' ')
|
||||||
self._log.debug(
|
self._log.debug(
|
||||||
"Banned IPs in postfix jail: %s",
|
"Banned IPs in postfix jail: %s",
|
||||||
ips['postfix']
|
ips['postfix']
|
||||||
|
|
Loading…
Reference in a new issue