Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: tolerate missing mac addresses better.
  • Loading branch information
jonseymour committed Dec 30, 2010
1 parent 956b9d7 commit 2791dea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions bin/geoloc.sh
Expand Up @@ -263,11 +263,14 @@ map()
local dir=$(map_dir $map)
test -d "$dir" || die "usage: map import-kismet map < file"

cut -f4,3 -d\; | sed 1d | sort | uniq | awk 'BEGIN { FS=";" } { print $2 " " $1 }' | while read mac ssid
rewrite-kismet | \
while read mac ssid
do
locate "$mac" "$ssid"
test -n "$mac" &&
loc=$(locate "$mac" "$ssid") &&
echo "$mac $ssid" &&
add "$map" "$mac"
done
done
}

build()
Expand All @@ -287,8 +290,8 @@ function generator() {
locations: [
$( mac_addresses $map | while read m
do
locate $m
echo ,
loc=$(locate $m)
test -n "$loc" && echo "${loc},"
done
)
]
Expand Down

0 comments on commit 2791dea

Please sign in to comment.