Update toriptables2.py
This commit is contained in:
parent
fc91f73018
commit
b92151b2e7
1 changed files with 8 additions and 3 deletions
|
@ -41,6 +41,8 @@ DNSPort 53
|
||||||
|
|
||||||
@register
|
@register
|
||||||
def restart_tor():
|
def restart_tor():
|
||||||
|
import sys
|
||||||
|
sys.tracebacklimit = 0
|
||||||
fnull = open(devnull, 'w')
|
fnull = open(devnull, 'w')
|
||||||
tor_restart = check_call(["service", "tor", "restart"],
|
tor_restart = check_call(["service", "tor", "restart"],
|
||||||
stdout=fnull, stderr=fnull)
|
stdout=fnull, stderr=fnull)
|
||||||
|
@ -72,11 +74,14 @@ DNSPort 53
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(
|
||||||
description='Tor Iptables script for loading and unloading iptables rules')
|
description=
|
||||||
parser.add_argument('-l', '--load',
|
'Tor Iptables script for loading and unloading iptables rules')
|
||||||
|
parser.add_argument('-l',
|
||||||
|
'--load',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='This option will load tor iptables rules')
|
help='This option will load tor iptables rules')
|
||||||
parser.add_argument('-f', '--flush',
|
parser.add_argument('-f',
|
||||||
|
'--flush',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='This option flushes the iptables rules to default')
|
help='This option flushes the iptables rules to default')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
Loading…
Reference in a new issue