Subversion Repositories sysadmin_scripts

Rev

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

Rev 140 Rev 143
Line 119... Line 119...
119
   my $string = shift;
119
   my $string = shift;
120
   $string =~ s/^\s+|\s+$//;
120
   $string =~ s/^\s+|\s+$//;
121
   return $string;
121
   return $string;
122
}
122
}
123
 
123
 
124
sub showDOMUs {
124
sub showReport {
125
   my $conf = shift;
125
   my $conf = shift;
126
   foreach my $node ( keys %$conf ) {
126
   foreach my $node ( keys %$conf ) {
127
      print "$node\n";
127
      print "$node\n";
128
      foreach my $virt ( keys %{ $conf->{$node}->{'virtuals'} } ) {
128
      foreach my $virt ( keys %{ $conf->{$node}->{'virtuals'} } ) {
129
         print "\t$virt\n";
129
         print "\t$virt\n";
Line 164... Line 164...
164
 
164
 
165
my $self = `hostname -f`;
165
my $self = `hostname -f`;
166
chomp $self;
166
chomp $self;
167
 
167
 
168
if ( $options{'s'} ) {
168
if ( $options{'s'} ) {
169
   &showDOMUs( $db );
169
   &showReport( $db );
170
} elsif ( ! $options{ 'n' } ) {
170
} elsif ( ! $options{ 'n' } ) {
171
   print STDERR "Updating the database\n" if $options{'v'};
171
   print STDERR "Updating the database\n" if $options{'v'};
172
   my $dirty = 0;
172
   my $dirty = 0;
173
   ( $dirty, $db ) = &updateDB( $db,$self, $options{'v'} );
173
   ( $dirty, $db ) = &updateDB( $db,$self, $options{'v'} );
174
   if ( $dirty ) {
174
   if ( $dirty ) {