1 #!/usr/bin/python 2 3 import dbus 4 import flimflam 5 import sys 6 7 if len(sys.argv) < 2: 8 print "Usage: %s <GUID> [<property> <value>]" % (sys.argv[0]) 9 sys.exit(1) 10 11 print "Attempting to configure service %s" % (sys.argv[1]) 12 13 flim = flimflam.FlimFlam(dbus.SystemBus()) 14 15 params = { "GUID" : sys.argv[1] } 16 argv = sys.argv[2:] 17 while argv: 18 property_key = argv[0] 19 value = argv[1] 20 if property_key in ["Priority"]: 21 params[property_key] = int(value) 22 elif property_key in ["AutoConnect", "WiFi.HiddenSSID", "EAP.UseSystemCAS", 23 "SaveCredentials"]: 24 params[property_key] = dbus.Boolean(value.lower() in ("true", "1")) 25 else: 26 params[property_key] = value 27 28 argv = argv[2:] 29 30 flim.manager.ConfigureService(params) 31