Check that interface name is provided
[connman] / test / set-passphrase
index db39554..f80d754 100755 (executable)
@@ -20,12 +20,15 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
+       if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
+               continue;
+
        for path in properties["Networks"]:
                network = dbus.Interface(bus.get_object("org.moblin.connman", path),
                                                "org.moblin.connman.Network")
 
                properties = network.GetProperties()
 
-               if (properties["WiFi.Name"] == sys.argv[1]):
+               if (properties["Name"] == sys.argv[1]):
                        print "Setting passphrase for %s" % (path)
                        network.SetProperty("WiFi.Passphrase", sys.argv[2])