Mysql-tools
Mysql-tools copied to clipboard
Fix possible error in logic and sed cleanup
Replaced the sed expression: since you're only accessing the variables that start with 'Slave_' it might make more sense to just look those ones up. I also found a problem with the logic unless I am getting it wrong: is_replication_ok() returns 1 if everything is correct, and that value triggers setup_replication(). I changed the values for the output on that function and the reference inside setup_replication() as well to 0, and now the script behaves as expected.