4 $rootpath = "../" if (!$rootpath);
5 $rootpath .= '/' if ($rootpath !~ /\/$/);
7 if ($ENV{'NET-SNMP-CONFIG'} &&
8 $ENV{'NET-SNMP-IN-SOURCE'}) {
9 # have env vars, pull from there
10 $ret{'nsconfig'} = $ENV{'NET-SNMP-CONFIG'};
11 $ret{'insource'} = $ENV{'NET-SNMP-IN-SOURCE'};
13 # don't have env vars, pull from command line and put there
14 GetOptions("NET-SNMP-CONFIG=s" => \$ret{'nsconfig'},
15 "NET-SNMP-IN-SOURCE=s" => \$ret{'insource'});
17 if ($ret{'insource'} eq "true" && $ret{'nsconfig'} eq "") {
18 $ret{'nsconfig'}="sh ROOTPATH../net-snmp-config";
19 } elsif ($ret{'nsconfig'} eq "") {
20 $ret{'nsconfig'}="net-snmp-config";
23 $ENV{'NET-SNMP-CONFIG'} = $ret{'nsconfig'};
24 $ENV{'NET-SNMP-IN-SOURCE'} = $ret{'insource'};
27 $ret{'nsconfig'} =~ s/ROOTPATH/$rootpath/;
29 $ret{'rootpath'} = $rootpath;