diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-03-26 01:29:22 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-03-26 01:29:22 -0700 |
commit | 35687e51f6bb14417777def599ba4f6cb65876de (patch) | |
tree | 7f91fadb064c44549fa0dbfe84f0a4e321ad6913 /test | |
parent | 71dc77ea6ceaf3d486a2d16305243687f6cdac24 (diff) | |
download | connman-35687e51f6bb14417777def599ba4f6cb65876de.tar.gz connman-35687e51f6bb14417777def599ba4f6cb65876de.tar.bz2 connman-35687e51f6bb14417777def599ba4f6cb65876de.zip |
Extend script for joining network with security options
Diffstat (limited to 'test')
-rwxr-xr-x | test/join-network | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/join-network b/test/join-network index 400f4978..576c6026 100755 --- a/test/join-network +++ b/test/join-network @@ -4,7 +4,7 @@ import sys import dbus if (len(sys.argv) < 2): - print "Usage: %s <ssid>" % (sys.argv[0]) + print "Usage: %s <ssid> [passphrase] [security]" % (sys.argv[0]) sys.exit(1) bus = dbus.SystemBus() @@ -26,5 +26,16 @@ for path in properties["Devices"]: print "[ %s ]" % (path) print "Attempting to join %s" % (sys.argv[1]) + if len(sys.argv) > 2: + if len(sys.argv) > 3: + security = sys.argv[3] + else: + security = "wpa2" + passphrase = sys.argv[2] + else: + security = "none" + passphrase = "" + device.JoinNetwork({ "WiFi.SSID": sys.argv[1], - "WiFi.Security": "none" }) + "WiFi.Security": security, + "WiFi.Passphrase": passphrase }) |