summaryrefslogtreecommitdiffstats
path: root/lib/network/monitor.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network/monitor.pm')
-rw-r--r--lib/network/monitor.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/network/monitor.pm b/lib/network/monitor.pm
index 43e9e78..9f5e302 100644
--- a/lib/network/monitor.pm
+++ b/lib/network/monitor.pm
@@ -17,14 +17,15 @@ sub new {
sub list_wireless {
my ($monitor, $o_intf) = @_;
my ($results, $list, %networks);
+ my $has_roaming;
#- first try to use mandi
eval {
$results = $monitor->call_method('ScanResults');
$list = $monitor->call_method('ListNetworks');
+ $has_roaming = 1;
};
- my $has_roaming = defined $results && defined $list;
#- try wpa_cli if we're root
- if ($@ && !$>) {
+ if (!$has_roaming && !$>) {
$results = `/usr/sbin/wpa_cli scan_results 2>/dev/null`;
$list = `/usr/sbin/wpa_cli list_networks 2>/dev/null`;
}