summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/network/monitor.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/network/monitor.pm b/lib/network/monitor.pm
index fb9247a..43e9e78 100644
--- a/lib/network/monitor.pm
+++ b/lib/network/monitor.pm
@@ -105,7 +105,16 @@ sub list_wireless {
sub select_network {
my ($o, $id) = @_;
my $method = 'SelectNetwork';
- $o->call_method($method, Net::DBus::dbus_uint32($id));
+ if ($o) {
+ $o->call_method($method, Net::DBus::dbus_uint32($id));
+ } else {
+ require run_program;
+ run_program::run("dbus-send", "--system", "--type=method_call",
+ "--dest=" . $monitor_service,
+ $monitor_path,
+ $monitor_interface . '.' . $method,
+ 'uint32:' . $id);
+ }
}
1;