summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-03-26 01:29:22 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-03-26 01:29:22 -0700
commit35687e51f6bb14417777def599ba4f6cb65876de (patch)
tree7f91fadb064c44549fa0dbfe84f0a4e321ad6913 /test
parent71dc77ea6ceaf3d486a2d16305243687f6cdac24 (diff)
downloadconnman-35687e51f6bb14417777def599ba4f6cb65876de.tar.gz
connman-35687e51f6bb14417777def599ba4f6cb65876de.tar.bz2
connman-35687e51f6bb14417777def599ba4f6cb65876de.zip
Extend script for joining network with security options
Diffstat (limited to 'test')
-rwxr-xr-xtest/join-network15
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 })