Changeset 188
- Timestamp:
- Nov 11, 2016, 12:21:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r186 r188 1118 1118 1119 1119 my $days_to_clean = 15; 1120 my $repairdns; 1120 1121 my $verbose; 1121 1122 my $database_has_changed; … … 1124 1125 'day|d=i' => \$days_to_clean, 1125 1126 'verbose|v' => \$verbose, 1127 'repairdns|r' => \$repairdns, 1126 1128 ); 1127 1129 1128 1130 my @vlan_name = get_list_network(); 1129 1131 1130 my $computerdb = {}; 1131 $computerdb = YAML::Syck::LoadFile("$KLASK_DB_FILE") if -e "$KLASK_DB_FILE"; 1132 my $computerdb = computerdb_load(); 1132 1133 my $timestamp = time; 1133 1134 … … 1199 1200 }; 1200 1201 } 1202 } 1203 } 1204 1205 if ($repairdns) { # Search and update unkown computer in reverse DNS 1206 LOOP_ON_COMPUTER: 1207 for my $one_computer (@computer) { 1208 next LOOP_ON_COMPUTER if $computerdb->{$one_computer}{hostname_fq} ne 'unknow'; 1209 1210 my $packed_ip = scalar gethostbyname($one_computer); 1211 next LOOP_ON_COMPUTER if not defined $packed_ip; 1212 1213 my $hostname_fq = scalar gethostbyaddr($packed_ip, AF_INET); 1214 next LOOP_ON_COMPUTER if not defined $hostname_fq; 1215 1216 $computerdb->{$one_computer}{hostname_fq} = $hostname_fq; 1217 $database_has_changed++; 1201 1218 } 1202 1219 }
Note: See TracChangeset
for help on using the changeset viewer.