Fix grep passwd in master.info, log err to stderr.

sync-replication
Andreas Granig 13 years ago
parent 25c99fd7ca
commit 55673a6101

@ -155,12 +155,12 @@ SQL
if(-f $minfo) {
my $mfh;
unless(open $mfh, '<', $minfo) {
print "Failed to open $minfo for syncing, replication not synced!\n";
print STDERR "Failed to open $minfo for syncing, replication not synced!\n";
next;
}
my @minfo_content = <$mfh>;
close $mfh;
unless(grep {/^${pass}\s*/} @minfo_content) {
unless(grep {/^${pass}\s*$/} @minfo_content) {
print " ---> update master info to master_host='$mhost', master_user='$user', master_password='$pass'\n" if $debug;
$dbh->do('SLAVE STOP') unless $test_mode;
$sth_master->execute($mhost, $user, $pass) unless $test_mode;

Loading…
Cancel
Save