Commit 99850d03 authored by sikeda's avatar sikeda
Browse files

[-dev] command line tools: check database connection any exit if it fail

git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@8889 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 094cd8af
......@@ -82,7 +82,12 @@ unless (Site->load) {
die 'config_error';
}
SDM::probe_db();
unless (SDM::check_db_connect('just_try') and SDM::probe_db()) {
printf STDERR
"Database %s defined in sympa.conf has not the right structure or is unreachable. verify db_xxx parameters in sympa.conf\n",
Site->db_name;
exit 1;
}
chdir Site->home;
......
......@@ -38,7 +38,7 @@ Site->load or die 'config_error';
## Probe Db if defined
if (Site->db_name and Site->db_type) {
unless (SDM::probe_db()) {
unless (SDM::check_db_connect('just_try') and SDM::probe_db()) {
die sprintf 'Database %s defined in sympa.conf has not the right structure or is unreachable. If you don\'t use any database, comment db_xxx parameters in sympa.conf', Site->db_name;
}
}
......
......@@ -47,7 +47,7 @@ $| = 1;
Site->load or die 'config_error';
if (Site->db_name and Site->db_type) {
unless (SDM::probe_db()) {
unless (SDM::check_db_connect('just_try') and SDM::probe_db()) {
die sprintf 'Database %s defined in sympa.conf has not the right structure or is unreachable. If you don\'t use any database, comment db_xxx parameters in sympa.conf', Site->db_name;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment