From 581c3a81fc81db5065ad8939d36ac284420f73c2 Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Sun, 21 Jul 2013 00:00:55 +0200 Subject: autoscan - keep logs of visited networks XXX IN PROGRESS, DONT EXPECT THIS TO WORK --- autoscan/autoscan.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 autoscan/autoscan.py (limited to 'autoscan') diff --git a/autoscan/autoscan.py b/autoscan/autoscan.py new file mode 100644 index 0000000..0c9a06b --- /dev/null +++ b/autoscan/autoscan.py @@ -0,0 +1,30 @@ +#!/bin/env python + +# autoscan - keep logs of visited networks +# XXX IN PROGRESS 20130721 laurent +# 2013, Laurent Ghigonis + +# Each time internet connectivity become available after a cut-off, +# keep a log of the following +# * ifconfig +# * if WIFI, iwconfig +# * route -n +# * traceroute +# * local net IP scan + +import subprocess + +TARGET = "8.8.8.8" +LOG = "autoscan.log" + +log = open(LOG, "a") + +res = -1 +while True: + res = subprocess.call(['ping', '-W', '1', '-c', '1', TARGET]) + if res == 0: + print "ping to", address, "OK" + elif res == 2: + print "no response from", address + else: + print "ping to", address, "failed!" -- cgit v1.2.3-59-g8ed1b