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

FIX: Existing environment variables have higher priority than config

parent d135061d
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,9 @@ if [ -z "$MAINPATH" ]; then ...@@ -33,6 +33,9 @@ if [ -z "$MAINPATH" ]; then
export MAINPATH export MAINPATH
fi fi
# Make a backup of the important environment variables.
my_env=$(export -p | grep -E '(MYSQL|DATABASE)')
source "$MAINPATH/config.defaults" source "$MAINPATH/config.defaults"
if [[ -r "$MAINPATH/.config" ]] ; then if [[ -r "$MAINPATH/.config" ]] ; then
...@@ -47,6 +50,9 @@ if [[ -z "$MYSQL_CMD" ]] ; then ...@@ -47,6 +50,9 @@ if [[ -z "$MYSQL_CMD" ]] ; then
exit 1 exit 1
fi fi
# Restore backup.
eval "$my_env"
export MYSQL_CMD export MYSQL_CMD
export MYSQLDUMP_CMD export MYSQLDUMP_CMD
export MYSQLADMIN_CMD export MYSQLADMIN_CMD
......
...@@ -97,7 +97,7 @@ function _setup_mytap() { ...@@ -97,7 +97,7 @@ function _setup_mytap() {
echo MyTAB framework is already installed [OK] echo MyTAB framework is already installed [OK]
return 0 return 0
fi fi
echo -n "Installing MyTAB framework ... " echo -n "Installing MyTAP framework ... "
pushd libs > /dev/null pushd libs > /dev/null
unzip -u mytap*.zip > /dev/null unzip -u mytap*.zip > /dev/null
pushd mytap*/ > /dev/null pushd mytap*/ > /dev/null
...@@ -105,7 +105,7 @@ function _setup_mytap() { ...@@ -105,7 +105,7 @@ function _setup_mytap() {
popd > /dev/null popd > /dev/null
rm -r mytap*/ rm -r mytap*/
popd > /dev/null popd > /dev/null
echo [DONE] echo "[DONE]"
} }
function install_db() { function install_db() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment