eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

start-adhoc (656B)


      1 #!/usr/bin/python3
      2 
      3 import dbus
      4 import sys
      5 
      6 if len(sys.argv) == 4:
      7 	open = False
      8 elif len(sys.argv) == 3:
      9 	open = True
     10 else:
     11 	print("Usage: %s <device> <ssid> [<passphrase>]" % (sys.argv[0]))
     12 	sys.exit(1)
     13 
     14 bus = dbus.SystemBus()
     15 device = dbus.Interface(bus.get_object("net.connman.iwd", sys.argv[1]),
     16                         "org.freedesktop.DBus.Properties")
     17 
     18 device.Set('net.connman.iwd.Device', 'Mode', 'ad-hoc')
     19 
     20 adhoc_iface = dbus.Interface(bus.get_object("net.connman.iwd", sys.argv[1]),
     21                                         'net.connman.iwd.AdHoc')
     22 
     23 if open:
     24 	adhoc_iface.StartOpen(sys.argv[2])
     25 else:
     26 	adhoc_iface.Start(sys.argv[2], sys.argv[3])