Update toriptables2.py

This commit is contained in:
Rupert Edwards 2016-07-16 21:49:37 +00:00 committed by GitHub
parent 76f44f5fa6
commit 6e18e80f7a

View file

@ -16,7 +16,6 @@ from sys import stdout, stderr
from atexit import register from atexit import register
from argparse import ArgumentParser from argparse import ArgumentParser
from json import load from json import load
from pynotify import init, Notification
from urllib2 import urlopen, URLError from urllib2 import urlopen, URLError
@ -65,10 +64,6 @@ DNSPort %s
else: else:
print(" {0}".format( print(" {0}".format(
"[\033[92m+\033[0m] Your IP is \033[92m%s\033[0m" % my_public_ip)) "[\033[92m+\033[0m] Your IP is \033[92m%s\033[0m" % my_public_ip))
init('toriptables2')
my_ip = Notification("Your public IP address is %s" % my_public_ip)
my_ip.show()
except CalledProcessError as err: except CalledProcessError as err:
print("[!] Command failed: %s" % err.cmd) print("[!] Command failed: %s" % err.cmd)
@ -122,14 +117,6 @@ if __name__ == '__main__':
load_tables.flush_iptables_rules() load_tables.flush_iptables_rules()
print(" {0}".format( print(" {0}".format(
"[\033[93m!\033[0m] Anonymizer status \033[91m[OFF]\033[0m")) "[\033[93m!\033[0m] Anonymizer status \033[91m[OFF]\033[0m"))
try:
my_real_ip = load(urlopen('http://jsonip.com'))['ip']
except URLError:
pass
else:
init('toriptables2')
my_own_ip = Notification("Your public IP address is %s" % my_real_ip)
my_own_ip.show()
else: else:
parser.print_help() parser.print_help()
except Exception as err: except Exception as err: