Skip to content
Snippets Groups Projects
Commit 1eb3290c authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: configure is obsolete

parent d8a3822b
No related branches found
No related tags found
No related merge requests found
...@@ -22,74 +22,8 @@ ...@@ -22,74 +22,8 @@
# ** end header # ** end header
# #
# Do to the new way environment variables are handled and how config files are
# read, this file is obsolete
echo "CURRENTLY NOT SUPPORTET" echo "CURRENTLY NOT SUPPORTET"
exit 1 exit 1
if [ -z "$UTILSPATH" ]; then
UTILSPATH="$(realpath $(dirname $0)/utils)"
export UTILSPATH
fi
# defaults
source config.defaults
OPTIONS=$(sed -r '/^(#|\s*$)/d' config.defaults | sed -r 's/=.*$//g')
# override with old config
if [ -e $MAINPATH/.config ]; then
source $MAINPATH/.config
fi
# DEBUG - print all options:
# for opt in $OPTIONS; do echo $opt = ${!opt}; done
# Promt the user to specify an option.
for opt in $OPTIONS; do
opt_default=$(echo "${!opt}" | sed 's/#.*$//g')
read -p "$opt [$opt_default]: " val
if [ ! ${#val} -eq 0 ]; then
eval "$opt=\"$val\""
fi
done
# check all options
printf "\n\n--- checking your configuration ---"
for opt in $OPTIONS; do
if [ -z "$opt" ]; then echo "${!opt} is not defined." ; fi ;
if [ "CMD" = "${opt:(-3)}" ]; then
printf "\n${opt} "
if test $(command -v ${!opt}) ; then
printf ". . . [OK]"
else
printf ". . . [FAILURE - could not find ${!opt}]"
fi
fi
done
printf "\n"
printf "\n\n--- finishing up ---"
if test $(command -v ${MYSQL_CONFIG_EDITOR_CMD}) ; then
LOGIN_PATH=caosdb_login_to_$DATABASE_NAME
OPTIONS=$(printf "$OPTIONS\nLOGIN_PATH")
$MYSQL_CONFIG_EDITOR_CMD remove --login-path=$LOGIN_PATH
printf "\nFor user $MYSQL_USER - "
$MYSQL_CONFIG_EDITOR_CMD set --login_path=$LOGIN_PATH --host=$MYSQL_HOST --user=root --password
else
printf "\nBecause there is no mysql_config_editor avaible, we need the password for the mysql user '$MYSQL_USER'.\n"
read -p "MYSQL_USER_PASSWORD []: " MYSQL_USER_PASSWORD
OPTIONS=$(printf "$OPTIONS\nMYSQL_USER_PASSWORD")
fi
# DEBUG - print all options:
# for opt in $OPTIONS; do echo $opt = ${!opt}; done
# write to $MAINPATH/.config
rm -f $MAINPATH/.config
for opt in $OPTIONS; do
esc_hash=${!opt//#/\\\#}
esc_dollar=${esc_hash//\$/'$$'}
esc_dq=${esc_dollar//\"/\\\"}
esc_sq=${esc_dq//\'/\\\'}
echo "$opt=\"$esc_sq\"" >> $MAINPATH/.config
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment