Files
MaxScale/system-test/masking_mysqltest_driver.sh
Esa Korhonen 08f5174915 MXS-2900 Rename maxscale-system-test directory to system-test
A link with the old directory name is provided.
2020-07-28 15:24:27 +03:00

29 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
script=`basename "$0"`
source=$src_dir/masking/$1/masking_rules.json
target=${maxscale_000_whoami}@${maxscale_000_network}:/home/${maxscale_000_whoami}/masking_rules.json
if [ ${maxscale_000_network} != "127.0.0.1" ] ; then
scp -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $source $target
ssh -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${maxscale_000_whoami}@${maxscale_000_network} chmod a+r /home/${maxscale_000_whoami}/masking_rules.json
else
cp $source /home/${maxscale_000_whoami}/masking_rules.json
fi
if [ $? -ne 0 ]
then
echo "error: Could not copy rules file to maxscale host."
exit 1
fi
echo $source copied to $target, restarting Maxscale
ssh -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${maxscale_000_whoami}@${maxscale_000_network} 'sudo service maxscale restart'
# [Read Connection Listener Master] in cnf/maxscale.maxscale.cnf.template.$1
port=4008
$src_dir/mysqltest_driver.sh $1 $src_dir/masking/$1 $port $maxscale_user $maxscale_password