Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions kismetdb/scripts/log_to_kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main():
parser.add_argument("--in", action="store", dest="infile",
help="Input (.kismet) file")
parser.add_argument("--out", action="store", dest="outfile",
help="Output filename (optional)")
default="out.kml", help="Output filename (optional)")
parser.add_argument("--start-time", action="store", dest="starttime",
help="Only list devices seen after given time")
parser.add_argument("--min-signal", action="store", dest="minsignal",
Expand All @@ -30,6 +30,8 @@ def main():
parser.add_argument("--ssid", action="store", dest="ssid",
help=("Only plot networks which match the SSID "
"(or SSID regex)"))
parser.add_argument("--debug", action="store_true", dest="debug",
help="Enable debug mode")

results = parser.parse_args()

Expand Down Expand Up @@ -97,14 +99,18 @@ def main():
title = mac

kml.newpoint(name=title,
coords=[(loc["kismet.common.location.lon"],
loc["kismet.common.location.lat"],
coords=[(loc["kismet.common.location.geopoint"][0],
loc["kismet.common.location.geopoint"][1],
loc["kismet.common.location.alt"])])

num_plotted = num_plotted + 1
except TypeError:
except TypeError as err:
if results.debug:
print("Type error: {}".format(err))
continue
except KeyError:
except KeyError as err:
if results.debug:
print("Key error: {}".format(err))
continue
kml.save(results.outfile)
print("Exported {} devices to {}".format(num_plotted, results.outfile))
Expand Down