Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 83 Rev 84
Line 111... Line 111...
111
   use Data::Dumper;
111
   use Data::Dumper;
112
   
112
   
113
   my $configuration = shift;
113
   my $configuration = shift;
114
   local $Data::Dumper::Purity = 1;
114
   local $Data::Dumper::Purity = 1;
115
   $Data::Dumper::Indent = 3;
115
   $Data::Dumper::Indent = 3;
116
   $Data::Dumper::Varname = '$configuration';
116
   $Data::Dumper::Varname = 'configuration';
117
   $Data::Dumper::Quotekeys = 1;
117
   $Data::Dumper::Quotekeys = 1;
118
   $Data::Dumper::Sortkeys = 1;
118
   $Data::Dumper::Sortkeys = 1;
-
 
119
   $Data::Dumper::Terse = 1;
119
   return Data::Dumper->Dump( [$configuration] );
120
   $configuration = '%configuration = ' . Data::Dumper->Dump( [$configuration] );
-
 
121
   return $configuration;
120
 
122
 
121
   #return $conf;
123
   #return $conf;
122
   #my $conf;
124
   #my $conf;
123
   #$conf .= "\$clientName = '" .   ( defined( $$configuration{'clientName'}   ) ? $$configuration{'clientName'}   : '' ) . "';\n";
125
   #$conf .= "\$clientName = '" .   ( defined( $$configuration{'clientName'}   ) ? $$configuration{'clientName'}   : '' ) . "';\n";
124
   #$conf .= "\$serialNumber = '" . ( defined( $$configuration{'serialNumber'} ) ? $$configuration{'serialNumber'} : '' ) . "';\n";
126
   #$conf .= "\$serialNumber = '" . ( defined( $$configuration{'serialNumber'} ) ? $$configuration{'serialNumber'} : '' ) . "';\n";
Line 176... Line 178...
176
   unless ( $config{'hostname'} ) {
178
   unless ( $config{'hostname'} ) {
177
      $hostname = `hostname -f`;
179
      $hostname = `hostname -f`;
178
      chomp $hostname;
180
      chomp $hostname;
179
      $config{'hostname'} = $hostname;
181
      $config{'hostname'} = $hostname;
180
   }
182
   }
181
   unless ( $config{'serialnumber'} ) {
183
   unless ( $config{'serialNumber'} ) {
182
      $serialNumber = `dmidecode -t 1 | grep 'Serial Number' | cut -d':' -f2` if `which dmidecode`;
184
      $serialNumber = `dmidecode -t 1 | grep 'Serial Number' | cut -d':' -f2` if `which dmidecode`;
183
      chomp $serialNumber;
185
      chomp $serialNumber;
184
      $serialNumber =~ s/\s//gi;
186
      $serialNumber =~ s/\s//gi;
185
      $config{'serialnumber'} = $serialNumber;
187
      $config{'serialNumber'} = $serialNumber;
186
   }
188
   }
187
   unless ( $config{'UUID'} ) {
189
   unless ( $config{'UUID'} ) {
188
      $UUID = `dmidecode -t 1 | grep -i uuid | cut -d':' -f2` if `which dmidecode`;
190
      $UUID = `dmidecode -t 1 | grep -i uuid | cut -d':' -f2` if `which dmidecode`;
189
      $UUID =~ s/\s//gi;
191
      $UUID =~ s/\s//gi;
190
      $config{'UUID'} = $UUID;
192
      $config{'UUID'} = $UUID;