From: Dobrica Pavlinusic Date: Thu, 27 Jan 2011 00:26:31 +0000 (+0000) Subject: support hostList in quotes as -h option X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=6e9be0d94e5d99b8259d3801c638728eaccde5c4;hp=f5ef8b2546333a4b7c7cf27ae62542346fbeeef5 support hostList in quotes as -h option this speeds up pre-archive hook --- diff --git a/bin/BackupPC_ASA_SearchUpdate b/bin/BackupPC_ASA_SearchUpdate index 5cff61f..20d5ccd 100755 --- a/bin/BackupPC_ASA_SearchUpdate +++ b/bin/BackupPC_ASA_SearchUpdate @@ -59,7 +59,7 @@ my $dbh = DBI->connect($dsn, $user, "", { RaiseError => 1, AutoCommit => 0 }); my %opt; -if ( !getopts("cdm:v:ijfq", \%opt ) ) { +if ( !getopts("cdm:v:ijfqh:", \%opt ) ) { print STDERR <{$host_key}->{'host'} || die "can't find host for $host_key"; - $sth->{hosts_by_name}->execute($hosts->{$host_key}->{'host'}); + next if $host_regex && $hostname =~ m/$host_regex/; + + $sth->{hosts_by_name}->execute($hostname); unless (($hostID) = $sth->{hosts_by_name}->fetchrow_array()) { $sth->{insert_hosts}->execute(