| Line 188... |
Line 188... |
| 188 |
print "Can not automatically do this at this time\nManually edit the file (press enter to continue)";
|
188 |
print "Can not automatically do this at this time\nManually edit the file (press enter to continue)";
|
| 189 |
my $t = <>;
|
189 |
my $t = <>;
|
| 190 |
}
|
190 |
}
|
| 191 |
}
|
191 |
}
|
| 192 |
|
192 |
|
| - |
|
193 |
|
| - |
|
194 |
# will validate the config, adding modules, scripts and transports if necessary
|
| 193 |
sub testConfig {
|
195 |
sub testConfig {
|
| 194 |
my $config = shift;
|
196 |
my $config = shift;
|
| 195 |
my @return;
|
197 |
my @return;
|
| 196 |
push @return, 'No client name given' unless $config->{'clientName'};
|
198 |
push @return, 'No client name given' unless $config->{'clientName'};
|
| 197 |
push @return, 'No host name given' unless $config->{'hostname'};
|
199 |
push @return, 'No host name given' unless $config->{'hostname'};
|
| - |
|
200 |
$config->{'serialNumber'} = $config->{'UUID'} if $config->{'serialNumber'} eq 'NotSpecified';
|
| 198 |
push @return, 'No serial number given' unless $config->{'serialNumber'};
|
201 |
push @return, 'No serial number given' unless $config->{'serialNumber'};
|
| 199 |
push @return, 'No UUID given' unless $config->{'UUID'};
|
202 |
push @return, 'No UUID given' unless $config->{'UUID'};
|
| - |
|
203 |
# if scriptDirs not defined, use installdir/scripts
|
| 200 |
push @return, 'No Module Directories given' unless $config->{'moduleDirs'};
|
204 |
$config->{'scriptDirs'} = [ $binDir . '/scripts' ] unless $config->{'scriptDirs'};
|
| - |
|
205 |
# if moduleDirs not defined, use installdir/modules
|
| 201 |
push @return, 'No Script Directories given' unless $config->{'scriptDirs'};
|
206 |
$config->{'moduleDirs'} = [ $binDir . '/modules' ] unless $config->{'moduleDirs'};
|
| - |
|
207 |
|
| - |
|
208 |
# ensure we have the default SaveLocal transport defined
|
| - |
|
209 |
unless ( defined $config->{'transports'}{'99'} ) {
|
| - |
|
210 |
$config->{'transports'}{'99'} = {
|
| - |
|
211 |
'name'=> 'SaveLocal',
|
| - |
|
212 |
'output directory' => '/tmp',
|
| - |
|
213 |
'sendScript' => 'save_local'
|
| - |
|
214 |
};
|
| - |
|
215 |
}
|
| 202 |
|
216 |
|
| 203 |
return @return ? join ( "\n", @return ) . "\n" : 'Ok';
|
217 |
return @return ? join ( "\n", @return ) . "\n" : 'Ok';
|
| 204 |
}
|
218 |
}
|
| 205 |
|
219 |
|
| 206 |
sub help {
|
220 |
sub help {
|