- Timestamp:
- Jul 18, 2018, 2:12:55 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r300 r301 1194 1194 my @domainsetdb = @{$computer_db->{$domainset_current}}; 1195 1195 1196 $cpt_mac=0;1197 for my $ value(@domainsetdb) {1198 for my $ id (keys %{$value}) {1199 if ($ ideq $mac) {1200 if ($ value->{$id}->{'ip'} eq $pool) {1196 #$cpt_mac=0; 1197 for my $computer (@domainsetdb) { 1198 for my $mac_current (keys %{$computer}) { 1199 if ($mac_current eq $mac) { 1200 if ($computer->{$mac}{'ip'} eq $pool) { 1201 1201 #splice(@{$computer_db->($domainset_current)} , $cpt_mac => 1); 1202 1202 my $timestamp = time; 1203 $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'modify_time'} = $timestamp; 1204 $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'enabled'} = 'no'; 1205 print $computer_db->{$domainset_current}[$cpt_mac]->{$id}->{'enabled'}."\n"; 1203 $computer->{$mac}{'modify_time'} = $timestamp; 1204 $computer->{$mac}{'enabled'} = 'no'; 1206 1205 ipamdb_save("$COMPUTER_YAML", $computer_db); 1207 print "Désactivation de la machine $mac du pool $pool [OK]\n"; 1206 print "Disabling machine $mac from pool $pool [OK]\n"; 1207 print "+-> Status:" . $computer->{$mac}{'enabled'} . "\n"; 1208 1208 exit; 1209 1209 } 1210 1210 else { 1211 print " Désactivation de la machine $mac [FAILED]\n";1212 print " La machine $mac n'appartient pas au pool $pool.\n";1211 print "Computer disable $mac [FAILED]\n"; 1212 print "+-> The computer $mac does not belong to the $pool pool.\n"; 1213 1213 exit; 1214 1214 } 1215 1215 } 1216 $cpt_mac++;1216 #$cpt_mac++; 1217 1217 } 1218 1218 }
Note: See TracChangeset
for help on using the changeset viewer.