MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / ipt_chain_exists

Function ipt_chain_exists

firewall.py:31–39  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

29
30
31def ipt_chain_exists(name):
32 argv = ['iptables', '-t', 'nat', '-nL']
33 p = ssubprocess.Popen(argv, stdout = ssubprocess.PIPE)
34 for line in p.stdout:
35 if line.startswith('Chain %s ' % name):
36 return True
37 rv = p.wait()
38 if rv:
39 raise Fatal('%r returned %d' % (argv, rv))
40
41
42def ipt(*args):

Callers 1

do_iptablesFunction · 0.85

Calls 2

waitMethod · 0.95
FatalClass · 0.85

Tested by

no test coverage detected