Merge branch 'search-3.2.0' of git.rot13.org:/git/BackupPC into search-3.2.0
[BackupPC.git] / bin / BackupPC_ASA_SearchUpdate
index de465b7..ba499f9 100755 (executable)
@@ -312,14 +312,15 @@ my $host_nr = 0;
 foreach my $host_key (@hosts) {
 
        my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key";
+       $hostname = lc $hostname;
 
-       next if $opt->host && ! grep { m/^$hostname$/ } @{ $opt->host };
+       next if $opt->host && ! grep { m/^$hostname$/i } @{ $opt->host };
 
        $sth->{hosts_by_name}->execute($hostname);
 
        unless (($hostID) = $sth->{hosts_by_name}->fetchrow_array()) {
                $sth->{insert_hosts}->execute(
-                       $hosts->{$host_key}->{'host'},
+                       $hostname,
                        $hosts->{$host_key}->{'ip'}
                );