Home | History | Annotate | Download | only in test-scripts
      1 #!/usr/bin/python
      2 
      3 import sys
      4 import dbus, flimflam
      5 
      6 if (len(sys.argv) < 2):
      7     print "Usage: %s <ssid> [passphrase] [security]" % (sys.argv[0])
      8     sys.exit(1)
      9 
     10 print "Attempting to configure hidden service %s" % (sys.argv[1])
     11 
     12 flim = flimflam.FlimFlam(dbus.SystemBus())
     13 
     14 ssid = sys.argv[1]
     15 if len(sys.argv) > 2:
     16     if len(sys.argv) > 3:
     17         security = sys.argv[3]
     18     else:
     19         security = "psk"
     20     passphrase = sys.argv[2]
     21 else:
     22     security = "none"
     23     passphrase = ""
     24 
     25 flim.manager.ConfigureService(({
     26       "Type" : "wifi",
     27       "Mode" : "managed",
     28       "SSID" : ssid,
     29       "WiFi.HiddenSSID" : True,
     30       "Security" : security,
     31       "Passphrase" : passphrase }))
     32