Subversion Repositories computer_asset_manager_v1

Rev

Rev 29 | Rev 74 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 33
Line 73... Line 73...
73
 
73
 
74
 
74
 
75
sub loadConfig {
75
sub loadConfig {
76
   my ( $confFileName, @searchPaths ) = @_;
76
   my ( $confFileName, @searchPaths ) = @_;
77
   my $configuration;
77
   my $configuration;
78
   for ( $i = 0; $i < @searchPaths; $i++ ) {
78
   for ( my $i = 0; $i < @searchPaths; $i++ ) {
79
      $filename = $searchPaths[$i] . '/' . $confFileName;
79
      my $filename = $searchPaths[$i] . '/' . $confFileName;
80
      if ( -e $filename ) {
80
      if ( -e $filename ) {
81
         #print "Found $filename\n";
81
         #print "Found $filename\n";
82
         open CONF, "<$filename" or warn "Could not read $filename: $!\n";
82
         open CONF, "<$filename" or warn "Could not read $filename: $!\n";
83
         $configuration = Load( join( '', <CONF> ) );
83
         $configuration = Load( join( '', <CONF> ) );
84
         close CONF;
84
         close CONF;
Line 101... Line 101...
101
   $CLIParams{'-bcc'}= qq/$$parameters{'mailBCC'}/     if $$parameters{'mailBCC'};
101
   $CLIParams{'-bcc'}= qq/$$parameters{'mailBCC'}/     if $$parameters{'mailBCC'};
102
   $CLIParams{'-l'}  = qq/$$parameters{'logFile'}/     if $$parameters{'logFile'};
102
   $CLIParams{'-l'}  = qq/$$parameters{'logFile'}/     if $$parameters{'logFile'};
103
   $CLIParams{'-a'}  = qq/$$parameters{'attachment'}/  if $$parameters{'attachment'};
103
   $CLIParams{'-a'}  = qq/$$parameters{'attachment'}/  if $$parameters{'attachment'};
104
   $CLIParams{'-o tls='} = qq/$$parameters{'tls'}/     if $$parameters{'tls'};
104
   $CLIParams{'-o tls='} = qq/$$parameters{'tls'}/     if $$parameters{'tls'};
105
   
105
   
106
   $commandLine = qq/$$parameters{'emailScript'}/;
106
   my $commandLine = qq/$$parameters{'emailScript'}/;
107
   die "Could not find executable $commandLine in sendEmailScript\n" unless -x $commandLine;
107
   die "Could not find executable $commandLine in sendEmailScript\n" unless -x $commandLine;
108
   $commandLine .= ' -q'; # make it act quietly
108
   $commandLine .= ' -q'; # make it act quietly
109
   foreach my $key ( keys %CLIParams ) {
109
   foreach my $key ( keys %CLIParams ) {
110
      # depending on whether the key ends in an = or not, we will or will not use a space
110
      # depending on whether the key ends in an = or not, we will or will not use a space
111
      # between the key and the parameter
111
      # between the key and the parameter