mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
changed station_list argument to accept multiple arguments in space or comma separated list
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
Example script:
|
Example script:
|
||||||
'./create_l3_stations.py --radio wiphy0 --ssid lanforge --password password --security wpa2'
|
'./create_l3_stations.py --radio wiphy0 --ssid lanforge --password password --security wpa2'
|
||||||
|
'./create_l3_stations.py --station_list sta00,sta01 --radio wiphy0 --ssid lanforge --password password --security wpa2'
|
||||||
|
'./create_l3_stations.py --station_list sta00 sta01 --radio wiphy0 --ssid lanforge --password password --security wpa2'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@@ -136,6 +138,34 @@ def main():
|
|||||||
--ap "00:0e:8e:78:e1:76"
|
--ap "00:0e:8e:78:e1:76"
|
||||||
--number_template 0000
|
--number_template 0000
|
||||||
--debug
|
--debug
|
||||||
|
|
||||||
|
python3 ./create_l3_stations.py
|
||||||
|
--upstream_port eth1
|
||||||
|
--radio wiphy0
|
||||||
|
--station_list sta00,sta01
|
||||||
|
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||||
|
--mode 1
|
||||||
|
{"auto" : "0",
|
||||||
|
"a" : "1",
|
||||||
|
"b" : "2",
|
||||||
|
"g" : "3",
|
||||||
|
"abg" : "4",
|
||||||
|
"abgn" : "5",
|
||||||
|
"bgn" : "6",
|
||||||
|
"bg" : "7",
|
||||||
|
"abgnAC" : "8",
|
||||||
|
"anAC" : "9",
|
||||||
|
"an" : "10",
|
||||||
|
"bgnAC" : "11",
|
||||||
|
"abgnAX" : "12",
|
||||||
|
"bgnAX" : "13",
|
||||||
|
--ssid netgear
|
||||||
|
--password admin123
|
||||||
|
--a_min 1000
|
||||||
|
--b_min 1000
|
||||||
|
--ap "00:0e:8e:78:e1:76"
|
||||||
|
--number_template 0000
|
||||||
|
--debug
|
||||||
''')
|
''')
|
||||||
|
|
||||||
required_args = None
|
required_args = None
|
||||||
@@ -158,7 +188,7 @@ def main():
|
|||||||
optional_args.add_argument('--number_template',
|
optional_args.add_argument('--number_template',
|
||||||
help='Start the station numbering with a particular number. Default is 0000',
|
help='Start the station numbering with a particular number. Default is 0000',
|
||||||
default=0000)
|
default=0000)
|
||||||
optional_args.add_argument('--station_list', help='Optional: User defined station names', action='append',
|
optional_args.add_argument('--station_list', help='Optional: User defined station names, can be a comma or space separated list', nargs='*',
|
||||||
default=None)
|
default=None)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -171,8 +201,12 @@ def main():
|
|||||||
end_id_=num_sta + int(args.number_template) - 1, padding_number_=10000,
|
end_id_=num_sta + int(args.number_template) - 1, padding_number_=10000,
|
||||||
radio=args.radio)
|
radio=args.radio)
|
||||||
else:
|
else:
|
||||||
station_list = args.station_list
|
if ',' in args.station_list[0]:
|
||||||
|
station_list = args.station_list[0].split(',')
|
||||||
|
elif ' ' in args.station_list[0]:
|
||||||
|
station_list = args.station_list[0].split()
|
||||||
|
else:
|
||||||
|
station_list = args.station_list
|
||||||
ip_var_test = CreateL3(host=args.mgr,
|
ip_var_test = CreateL3(host=args.mgr,
|
||||||
port=args.mgr_port,
|
port=args.mgr_port,
|
||||||
number_template=str(args.number_template),
|
number_template=str(args.number_template),
|
||||||
|
|||||||
Reference in New Issue
Block a user