Subversion Repositories camp_sysinfo_client_3

Rev

Rev 43 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 43 Rev 45
Line 379... Line 379...
379
            );
379
            );
380
   } # foreach file
380
   } # foreach file
381
   return 1;
381
   return 1;
382
}
382
}
383
 
383
 
384
sub makeConfig {
-
 
385
   my @configFileNames = @_;
-
 
386
   my %config;
-
 
387
   my $clientName;
-
 
388
   my $serialNumber;
-
 
389
   my $hostname;
-
 
390
   my @moduleDirs;
-
 
391
   my @scriptDirs;
-
 
392
   my $transports = {};
-
 
393
 
-
 
394
   foreach my $config ( @configFileNames ) {
-
 
395
      open CONF,"<$config" or die "could not open $config: $!\n";
-
 
396
      my $contents = join( '', <CONF> );
-
 
397
      close CONF;
-
 
398
      # now, eval the information we just read.
-
 
399
      # NOTE: we must turn off strict while doing this, and we die if something breaks.
-
 
400
      no strict "vars"; eval( $contents ); use strict "vars"; die "Error during eval: $@\n" if $@;
-
 
401
   }
-
 
402
 
-
 
403
   $config{'clientName'} = $clientName;
-
 
404
   $config{'serialNumber'} = $serialNumber;
-
 
405
   $config{'hostname'} = $hostname;
-
 
406
   $config{'moduleDirs'} = [ @moduleDirs ];
-
 
407
   $config{'scriptDirs'} = [ @scriptDirs ];
-
 
408
   $config{'transports'} = $transports;
-
 
409
   return \%config;
-
 
410
}
-
 
411
 
-
 
412
sub postInstall {
384
sub postInstall {
413
   my $install = shift;
385
   my $install = shift;
414
 
386
 
415
   # set up crontab, if necessary
387
   # set up crontab, if necessary
416
   &runCommand( $$install{'crontab'} ) if defined ( $$install{'crontab'} );
388
   &runCommand( $$install{'crontab'} ) if defined ( $$install{'crontab'} );