24 | Smart Scripting
www.dell.com | support.dell.com
Figure 3-3. PERL Script with API function call: Example
Table 3-2 describes the supported functions and required arguments that you can use
in PERL scripts run on a Dell Force10 switch to connect through a telnet session and
gather information or configure parameters through the CLI.
#!/usr/pkg/bin/perl -w
require '/usr/pkg/scripts/smartutils/F10SmartUtils.pl'; <------ Load the PERL API
usage() if ($#ARGV < 1);
($start,$end)=@ARGV;
$startVlan = $start;
$endVlan = $end;
for (my $i=$startVlan;$i<=$endVlan;$i++) {
my $createvlanId = F10CreateVlanId($i); <-------------------- Invoke a PERL API function
}
sub usage {
print "usage: createVlans.pl <start> <end>\n";
exit;
}