Files
wlan-lanforge-scripts/lf_many_vphy.pl
Ben Greear 72712ff548 Add scripts from the tools directory in the private Candela repo.
These scripts will now be publicly available in a git repo for
easier shared development and change tracking.
2017-10-06 13:41:50 -07:00

33 lines
713 B
Perl
Executable File

#!/usr/bin/perl -w
# Create lots of virtual radios with stations.
# Note that lf_associate_ap.pl has many more options that
# are not currently used here.
use strict;
use Getopt::Long;
my $usage = "$0
[--num_radios { number } ]
[--ssid {ssid}]
";
my $num_radios = 1;
my $ssid = "ssid";
GetOptions (
'num_radios|r=i' => \$num_radios,
'ssid|s=s' => \$ssid,
) || (print($usage) && exit(1));
my $i;
for ($i = 0; $i < $num_radios; $i++) {
my $idx = $i + 1;
my $sta = 600 + $idx;
my $cmd = "./lf_associate_ap.pl --resource 1 --radio vphy$idx --vrad_chan 1 --num_stations 1 --first_sta sta$sta --action add --first_ip DHCP --ssid $ssid";
print "$cmd\n";
system($cmd);
}