Skip to content
Snippets Groups Projects
Unverified Commit f351aceb authored by Daniel's avatar Daniel
Browse files

FIX: More strinct error handling, message if commands are not found.

parent 0338357e
No related branches found
No related tags found
No related merge requests found
......@@ -23,13 +23,14 @@
# # Commands
# The MySQL client program.
MYSQL_CMD=$(command -v mysql)
MYSQL_CMD=$(command -v mysql || echo "mysql not found!" >&2)
# The mysqladmin program which comes with the MySQL client.
MYSQLADMIN_CMD=$(command -v mysqladmin)
MYSQLADMIN_CMD=$(command -v mysqladmin || echo "mysqladmin not found!" >&2)
# The mysqldump program which comes with the MySQL client.
MYSQLDUMP_CMD=$(command -v mysqldump)
MYSQLDUMP_CMD=$(command -v mysqldump || echo "mysqldump not found!" >&2)
# The mysql_config_editor program which is used to store the credentials.
MYSQL_CONFIG_EDITOR_CMD=$(command -v mysql_config_editor)
MYSQL_CONFIG_EDITOR_CMD=$(command -v mysql_config_editor \
|| echo "mysql_config_editor not found!" >&2)
# # MySQL Connection
# The host of the MySQL server.
......
......@@ -19,13 +19,19 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Load setting from different files, in this order:
# - config.defaults
# - .config
# - config.defaults (in the current directory)
# - .config (in the current directory)
# - The file given in ENV_FILE.
[[ -n "config.defaults" ]] && source "config.defaults"
[[ -n ".config" ]] && source ".config"
[[ -n "$ENV_FILE" ]] && source "$ENV_FILE"
if [[ -r "config.defaults" ]] ; then
source "config.defaults"
fi
if [[ -r ".config" ]] ; then
source ".config"
fi
if [[ -n "$ENV_FILE" ]] ; then
source "$ENV_FILE"
fi
export MYSQL_CMD
export MYSQLDUMP_CMD
......
......@@ -22,6 +22,8 @@
#
# ** end header
set -e
INSTALL_SQL_FILE="db_2_0.sql"
if [ -z "$UTILSPATH" ]; then
......@@ -29,8 +31,6 @@ if [ -z "$UTILSPATH" ]; then
export UTILSPATH
fi
set -e
source $UTILSPATH/load_settings.sh
source $UTILSPATH/helpers.sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment