hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
package HotSaNICmod::common;
sub version {
($VERSION = '$Revision: 1.2 $') =~ s/.*(\d+\.\d+).*/$1/;
return "common.pm $VERSION";
}
sub configure {
$MODARGS{NFSPARTS}=0;
$MODARGS{NUM}=0;
# build summary of all partitions with existing databases
#
opendir(DIR, "rrd") || HotSaNICmod::dupe_control("die",$MODNAME,": can't open dir $!");
@arr = grep(/\.rrd/,readdir(DIR));
closedir DIR;
foreach $_ (@arr) {
($name) = split /\.rrd/;
$MODARGS{"DRIVE:$name"}=0;
}
# add configured drives
foreach (@_) {
($var,$value)=HotSaNICparser::parse_line($_);
if ($var eq "DRIVE") {
my ($dev,$name)=split /,/,$value;
if (!defined $MODARGS{$dev}) { $MODARGS{NUM}++; }
$MODARGS{"DRIVE:$dev"}=1;
if ( index($dev,":") >0 ) { $MODARGS{NFSPARTS}++; }
}
}
return %MODARGS
}
1;