diff --git a/sanity.php b/sanity.php index 38bdeea..0f24b3b 100755 --- a/sanity.php +++ b/sanity.php @@ -96,7 +96,8 @@ $current = $block->current(); if ($current['height']==1) { echo "Bootstrapping!\n"; $db_name=substr($_config['db_connect'], strrpos($_config['db_connect'], "dbname=")+7); - echo "DB name: $db_name\n"; + $db_host=substr($_config['db_connect'], strrpos($_config['db_connect'], "host=")+5, strrpos($_config['db_connect'], ";") - strlen($_config['db_connect'])); + echo "DB name: $db_name, DB host: $db_host\n"; echo "Downloading the blockchain dump from arionum.info\n"; $arofile=__DIR__ . '/tmp/aro.sql'; if (file_exists("/usr/bin/curl")) { @@ -109,7 +110,7 @@ if ($current['height']==1) { echo "Importing the blockchain dump\n"; - system("mysql -u ".escapeshellarg($_config['db_user'])." -p".escapeshellarg($_config['db_pass'])." ".escapeshellarg($db_name). " < ".$arofile); + system("mysql -h ".escapeshellarg($db_host)." -u ".escapeshellarg($_config['db_user'])." -p".escapeshellarg($_config['db_pass'])." ".escapeshellarg($db_name). " < ".$arofile); echo "Bootstrapping completed. Sleeping for 3 min. \n"; sleep(180); $current = $block->current();