Skip to content
Snippets Groups Projects
Commit f7f878f6 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

shell fixes in dbdetect functions

parent 0e96a36c
No related branches found
No related tags found
1 merge request!129Db Profiles
......@@ -11,6 +11,9 @@
# before using these functions.
#
# ----------------------------------------------------------------------
# ah - Axel Hahn <axel.hahn@unibe.ch>
#
# 2024-03-15 ah v1.0 first public version
# ======================================================================
# ----------------------------------------------------------------------
......@@ -20,7 +23,7 @@
DBD_BASEDIR=plugins/localdump/profiles
declare -A DBD_PARAMS
DBD_INI=
DBD_INIFILE=
# ----------------------------------------------------------------------
......@@ -77,7 +80,7 @@ function dbdetect.validate(){
local _config="${1:-$DBD_INIFILE}"
# show errors in profile ini files
ini.validate "$_config" "$( dirname $0)/includes/dbdetect_validate_profile_ini.sh" 0 && dbdetect._wd "OK: Validation of '$_config' successful"
ini.validate "$_config" "$( dirname "$0")/includes/dbdetect_validate_profile_ini.sh" 0 && dbdetect._wd "OK: Validation of '$_config' successful"
}
# check if the requirements for a database match
......@@ -85,7 +88,7 @@ function dbdetect.validate(){
function dbdetect.exists(){
local _config="$1"
DBD_PARAMS=
DBD_PARAMS=()
local _found=0
......@@ -140,7 +143,7 @@ function dbdetect.exists(){
local filetype; filetype=$( ini.value "type" )
if [ -n "${filetype}" ]; then
local myfiles; declare -a myfiles
local myfiles
for myfile in $( ini.value "file[]" )
do
if ! file -b "${myfile}" | grep -i "$filetype" >/dev/null; then
......@@ -173,8 +176,8 @@ function dbdetect.exists(){
ini.set "$_config" "set"
local value
local dbuser=$( ini.value "dbuser" )
local dbpassword=$( ini.value "dbpassword" )
local dbuser; dbuser=$( ini.value "dbuser" )
local dbpassword; dbpassword=$( ini.value "dbpassword" )
for mykey in env params
do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment