diff options
author | Martin Xu <martin.xu@intel.com> | 2010-03-25 11:36:50 +0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-03-25 15:07:47 +0100 |
commit | 6ba6bc810607ee7d9a02ac7ca5024334fb6660a6 (patch) | |
tree | 7a936bf432062d00f787a0535d205c070de2e9d9 /test | |
parent | 5b32a078419ce912b4d7083102fa78310c4a2f01 (diff) | |
download | connman-6ba6bc810607ee7d9a02ac7ca5024334fb6660a6.tar.gz connman-6ba6bc810607ee7d9a02ac7ca5024334fb6660a6.tar.bz2 connman-6ba6bc810607ee7d9a02ac7ca5024334fb6660a6.zip |
Set netmask and gateway as the mandatory parameters of test/set-address
Diffstat (limited to 'test')
-rwxr-xr-x | test/set-address | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/set-address b/test/set-address index c80eaed2..529b6351 100755 --- a/test/set-address +++ b/test/set-address @@ -3,8 +3,8 @@ import sys import dbus -if (len(sys.argv) < 2): - print "Usage: %s <address> [netmask]" % (sys.argv[0]) +if (len(sys.argv) < 3): + print "Usage: %s <address> <netmask> <gateway>" % (sys.argv[0]) sys.exit(1) bus = dbus.SystemBus() @@ -22,12 +22,8 @@ for path in properties["Services"]: print "Setting address %s for %s" % (sys.argv[1], path) - if len(sys.argv) > 2: - service.SetProperty("IPv4.Configuration", - { "Method": "manual", "Address": sys.argv[1], - "Netmask": sys.argv[2] }) - else: - service.SetProperty("IPv4.Configuration", - { "Method": "manual", "Address": sys.argv[1] }) + service.SetProperty("IPv4.Configuration", + { "Method": "manual", "Address": sys.argv[1], + "Netmask": sys.argv[2], "Gateway": sys.argv[3]}) print |