Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 26 Rev 28
Line 1... Line 1...
1
#!/usr/bin/env perl
1
#!/usr/bin/env perl
2
 
2
 
3
use warnings;
3
use warnings;
4
use strict;
4
use strict;
5
 
5
 
6
our $VERSION = '1.0.1';
6
our $VERSION = '1.0.2';
7
 
7
 
8
# find our location and use it for searching for libraries
8
# find our location and use it for searching for libraries
9
BEGIN {
9
BEGIN {
10
   use FindBin;
10
   use FindBin;
11
   use File::Spec;
11
   use File::Spec;
Line 23... Line 23...
23
   # we install it in /opt, so try there
23
   # we install it in /opt, so try there
24
   foreach my $current ( @possibles ) {
24
   foreach my $current ( @possibles ) {
25
      return $current if -x $current;
25
      return $current if -x $current;
26
   }
26
   }
27
   if ( &yesno( "You are asking for sendEmail, but I don't see it on the system\nWould you like me to automatically download and install" ) ) {
27
   if ( &yesno( "You are asking for sendEmail, but I don't see it on the system\nWould you like me to automatically download and install" ) ) {
28
      $path = `perl getSendEmail.pl`;
28
      my $path = `perl getSendEmail.pl`;
29
      chomp $path;
29
      chomp $path;
30
      return $path;
30
      return $path;
31
   }
31
   }
32
   return '';
32
   return '';
33
}
33
}
Line 55... Line 55...
55
   $$transport{'sendScript'} = $$fields{'sendScript'} unless $$transport{'sendScript'};
55
   $$transport{'sendScript'} = $$fields{'sendScript'} unless $$transport{'sendScript'};
56
   $$transport{'-name-'} = $type unless $$transport{'-name-'};
56
   $$transport{'-name-'} = $type unless $$transport{'-name-'};
57
   my $allKeys = $$fields{'keys'};
57
   my $allKeys = $$fields{'keys'};
58
   foreach my $key ( @$allKeys ) {
58
   foreach my $key ( @$allKeys ) {
59
      if ( $key eq 'sendEmailScriptLocation' && ! -e $$transport{$key} ) {
59
      if ( $key eq 'sendEmailScriptLocation' && ! -e $$transport{$key} ) {
60
         $temp = &findSendEmail( $$transport{$key} );
60
         my $temp = &findSendEmail( $$transport{$key} );
61
         $$transport{$key} = $temp if $temp;
61
         $$transport{$key} = $temp if $temp;
62
      }
62
      }
63
      $$transport{$key} = &getAnswer( "$key ", $$transport{$key} ? $$transport{$key} : '' );
63
      $$transport{$key} = &getAnswer( "$key ", $$transport{$key} ? $$transport{$key} : '' );
64
   }
64
   }
65
   return ( $priority, $transport );
65
   return ( $priority, $transport );
Line 103... Line 103...
103
      &showTransports( $priority, $$transports{ $priority } );
103
      &showTransports( $priority, $$transports{ $priority } );
104
      print '='x40 . "\n";
104
      print '='x40 . "\n";
105
   }
105
   }
106
 
106
 
107
   while ( &yesno( "Would you like to add any other transport mechanisms?" ) ) {
107
   while ( &yesno( "Would you like to add any other transport mechanisms?" ) ) {
108
      $newType = &getAnswer( 'Type of Transport? ', keys %sendTypes );
108
      my $newType = &getAnswer( 'Type of Transport? ', keys %sendTypes );
109
      my ( $priority,$temp ) = &setUpTransport( 99, {}, $sendTypes{$newType}, $newType );
109
      my ( $priority,$temp ) = &setUpTransport( 99, {}, $sendTypes{$newType}, $newType );
110
      $$transports{$priority} = $temp;
110
      $$transports{$priority} = $temp;
111
   }
111
   }
112
 
112
 
113
   foreach my $priority ( sort { $a <=> $b } keys %$transports ) {
113
   foreach my $priority ( sort { $a <=> $b } keys %$transports ) {