Skip to content
Snippets Groups Projects

Db Profiles

1 file
+ 20
1
Compare changes
  • Side-by-side
  • Inline
+ 20
1
@@ -31,6 +31,25 @@ function dbdetect._wd(){
test "$DBD_DEBUG" -ne "0" && color.echo "darkgray" "DEBUG: $*" >&2
}
# check if a process name exisats
# param string regex to find in ps -ef output
# param bool flag to skip; default: none = abort on miss
function dbdetect._requireProcess(){
# echo "CHECK process $1"
# ps -ef | grep -v grep | grep -E "$1" >/dev/null
pgrep -l "$1" >/dev/null
rcself=$?
if [ $rcself -ne 0 ]; then
rc=$rc+$rcself
echo "INFO: missing process $1"
if [ -z "$2" ]; then
exit 4
fi
return 1
fi
return 0
}
# get a list of all config files
# param string full path of ini file
function dbdetect.getConfigs(){
@@ -89,7 +108,7 @@ function dbdetect.exists(){
local binary; binary=$( ini.value "binary" )
if [ -n "${binary}" ]; then
for mybinary in $( echo "${binary}" | tr "," " " ); do
if ! j_requireBinary "$mybinary" 1 >/dev/null 2>&1; then
if ! dbdetect._requireProcess "$mybinary" 1 >/dev/null 2>&1; then
dbdetect._wd "... Missing binary: ${mybinary}"
return 1
fi
Loading