Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
0a3e7a21
Commit
0a3e7a21
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add function dbdetect._requireProcess
parent
13dc1dc4
Branches
Branches containing commit
No related tags found
1 merge request
!129
Db Profiles
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/dbdetect.class.sh
+20
-1
20 additions, 1 deletion
includes/dbdetect.class.sh
with
20 additions
and
1 deletion
includes/dbdetect.class.sh
+
20
−
1
View file @
0a3e7a21
...
@@ -31,6 +31,25 @@ function dbdetect._wd(){
...
@@ -31,6 +31,25 @@ function dbdetect._wd(){
test
"
$DBD_DEBUG
"
-ne
"0"
&&
color.echo
"darkgray"
"DEBUG:
$*
"
>
&2
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
# get a list of all config files
# param string full path of ini file
# param string full path of ini file
function
dbdetect.getConfigs
(){
function
dbdetect.getConfigs
(){
...
@@ -89,7 +108,7 @@ function dbdetect.exists(){
...
@@ -89,7 +108,7 @@ function dbdetect.exists(){
local
binary
;
binary
=
$(
ini.value
"binary"
)
local
binary
;
binary
=
$(
ini.value
"binary"
)
if
[
-n
"
${
binary
}
"
]
;
then
if
[
-n
"
${
binary
}
"
]
;
then
for
mybinary
in
$(
echo
"
${
binary
}
"
|
tr
","
" "
)
;
do
for
mybinary
in
$(
echo
"
${
binary
}
"
|
tr
","
" "
)
;
do
if
!
j
_require
Binary
"
$mybinary
"
1
>
/dev/null 2>&1
;
then
if
!
dbdetect.
_require
Process
"
$mybinary
"
1
>
/dev/null 2>&1
;
then
dbdetect._wd
"... Missing binary:
${
mybinary
}
"
dbdetect._wd
"... Missing binary:
${
mybinary
}
"
return
1
return
1
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment