From 3f32337ada5e7ffe08f0ff36d0324e4c02d3d4b0 Mon Sep 17 00:00:00 2001 From: Ruzicka Pavel Date: Fri, 16 Sep 2016 23:46:43 +0200 Subject: [PATCH] wifi-probes remove false date in notification etc --- wifi-probes/hoover-start.sh | 2 +- wifi-probes/hoover.pl | 8 ++++++-- wifi-probes/wifi-probes.service | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wifi-probes/hoover-start.sh b/wifi-probes/hoover-start.sh index b25b014..b4d45d6 100755 --- a/wifi-probes/hoover-start.sh +++ b/wifi-probes/hoover-start.sh @@ -52,7 +52,7 @@ function main_start { touch ${DUMPFILE} && echo "** dumpfile is ${DUMPFILE}" while read -r LINE; do - if [[ $LINE == *probe* ]] ; then + if [[ $LINE == *ProbeReq* ]] ; then find_dbus_session #echo "$(echo \"${LINE}\"|sed 's/.*++//')" >> /tmp/wifi-probes.debug su ruza -c "notify-send \"$LINE\"" diff --git a/wifi-probes/hoover.pl b/wifi-probes/hoover.pl index 55525a1..0a857e4 100755 --- a/wifi-probes/hoover.pl +++ b/wifi-probes/hoover.pl @@ -70,6 +70,7 @@ my $options = GetOptions( "tshark-path=s" => \$tsharkPath, "dumpfile=s" => \$dumpFile, ); +my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); if ($help) { print <<_HELP_; @@ -124,7 +125,8 @@ sub dumpNetworks { } for $key ( keys %detectedSSID) { - #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($detectedSSID{$key}[2]); + ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); + #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($detectedSSID{$key}[2]); #my $lastSeen = sprintf("%04d/%02d/%02d %02d:%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec); my $lastSeen = $detectedSSID{$key}[3]; print STDOUT sprintf("## %-20s %-30s %10s %-20s\n", $detectedSSID{$key}[2], @@ -161,6 +163,7 @@ if ($pid) { my $newKey = $2; print DEBUG "$macAddress : $newKey\n"; my $time=localtime(); + my $ltime="$hour:$min:$sec"; if (! $detectedSSID{$newKey}) { # New network found! my @newSSID = ( $newKey, # SSID @@ -169,7 +172,8 @@ if ($pid) { $time); # Seen now $detectedSSID{$newKey} = [ @newSSID ]; $uniqueSSID++; - print STDOUT "New probe request from $macAddress with SSID: $newKey [$uniqueSSID] at $time\n"; + #print STDOUT "ProbeReq from $macAddress to SSID:$newKey [$uniqueSSID] \@$ltime\n"; + print STDOUT "ProbeReq from $macAddress to SSID:$newKey [$uniqueSSID]\n"; if ( $dumpImmediately ) { dumpNetworks; #system("/bin/cat", "/home/ruza/bin/wifi-probe-requests/hoover/$dumpFile"); diff --git a/wifi-probes/wifi-probes.service b/wifi-probes/wifi-probes.service index c2c3b05..6326561 100644 --- a/wifi-probes/wifi-probes.service +++ b/wifi-probes/wifi-probes.service @@ -5,7 +5,6 @@ Description=wifi-probe-scanner Type=simple NotifyAccess=all RemainAfterExit=yes -# just call /bin/true and let psd-resync.service do it for speed #Environment=XDG_RUNTIME_DIR=/run/user/1000/ ExecStart=/usr/local/bin/hoover-start.sh start ExecStop=/usr/local/bin/hoover-start.sh stop