Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 37 Rev 40
Line 1... Line 1...
1
#!/usr/bin/env perl
1
#!/usr/bin/env perl
2
 
2
 
3
package sysinfoconf;
3
package sysinfoconf;
4
 
4
 
5
our $VERSION = '1.1.0';
5
our $VERSION = '1.1.1';
6
use warnings;
6
use warnings;
7
use strict;  
7
use strict;  
8
 
8
 
9
use Data::Dumper;
9
use Data::Dumper;
10
use File::Basename;
10
use File::Basename;
Line 142... Line 142...
142
   $thisAnswer = $default unless $thisAnswer;
142
   $thisAnswer = $default unless $thisAnswer;
143
   return $thisAnswer;
143
   return $thisAnswer;
144
}
144
}
145
 
145
 
146
sub yesno {
146
sub yesno {
147
   my $prompt = shift;
147
   my ( $prompt, $default ) = @_;
-
 
148
   $default = 'yes' unless $default;
148
   my $answer = &getAnswer( $prompt, ('yes','no' ) );
149
   my $answer = &getAnswer( $prompt, $default eq 'yes' ? ('yes','no' ) : ('no', 'yes') );
149
   return lc( substr( $answer, 0, 1 ) ) eq 'y';
150
   return lc( substr( $answer, 0, 1 ) ) eq 'y';
150
}
151
}
151
 
152
 
152
# runs a system command. Also, if in testing mode, simply shows what
153
# runs a system command. Also, if in testing mode, simply shows what
153
# would have been done.
154
# would have been done.