Changed location where logs opened

So as to fix bug where files were opened prior to checking if you have root.
This commit is contained in:
David Dworken 2014-11-09 14:46:41 -05:00
parent ec04312cb1
commit add164236c

View file

@ -153,8 +153,6 @@ C = '\033[36m' # cyan
GR = '\033[37m' # gray GR = '\033[37m' # gray
T = '\033[93m' # tan T = '\033[93m' # tan
logger = open('LANspy.log.txt', 'w+')
DN = open(os.devnull, 'w')
############################# #############################
##### Start LANs.py Code#### ##### Start LANs.py Code####
############################ ############################
@ -1589,6 +1587,8 @@ def stop(signal, frame):
if __name__ == "__main__": if __name__ == "__main__":
if not os.geteuid() == 0: if not os.geteuid() == 0:
exit("\nPlease run as root\n") exit("\nPlease run as root\n")
logger = open('LANspy.log.txt', 'w+')
DN = open(os.devnull, 'w')
args = parse_args() args = parse_args()
if args.pcap: if args.pcap:
pcap_handler(args) pcap_handler(args)