Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-passive-client
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
Open Source
icinga-passive-client
Commits
4dfce302
Commit
4dfce302
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add filecheck if they are writable
parent
1df2a0ce
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
icinga-cli.sh
+18
-2
18 additions, 2 deletions
icinga-cli.sh
with
18 additions
and
2 deletions
icinga-cli.sh
+
18
−
2
View file @
4dfce302
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
_product
=
"ICINGA PASSIVE CLIENT"
_product
=
"ICINGA PASSIVE CLIENT"
_version
=
"0.
5
"
_version
=
"0.
6
"
_license
=
"GNU GPL 3.0"
_license
=
"GNU GPL 3.0"
_copyright
=
'(c) 2020 Institute for Medical Education * University of Bern'
_copyright
=
'(c) 2020 Institute for Medical Education * University of Bern'
...
@@ -113,7 +113,18 @@ function loopChecks(){
...
@@ -113,7 +113,18 @@ function loopChecks(){
_log
"---------- starting in a permanent loop"
_log
"---------- starting in a permanent loop"
echo
"Serviceloop started
`
date
`
- process id
$$
"
>
"
${
lockfile
}
"
echo
"Serviceloop started
`
date
`
- process id
$$
"
>
"
${
lockfile
}
"
_getFileSnapshot>
$snapShotStart
if
[
$?
-ne
0
]
;
then
_log
"ABORT: Lock file is not writable
${
lockfile
}
."
ls
-l
"
${
lockfile
}
"
exit
1
fi
_getFileSnapshot>
${
snapShotStart
}
if
[
$?
-ne
0
]
;
then
_log
"ABORT: Snapshot file is not writable
${
snapShotStart
}
."
ls
-l
"
${
snapShotStart
}
"
exit
1
fi
while
true
;
do
while
true
;
do
# typeset -i local iSleep=$(($RANDOM%$sleeptime))
# typeset -i local iSleep=$(($RANDOM%$sleeptime))
# sleep minimum is half of $sleeptime
# sleep minimum is half of $sleeptime
...
@@ -123,6 +134,11 @@ function loopChecks(){
...
@@ -123,6 +134,11 @@ function loopChecks(){
_log
"______________________________________________________________________"
_log
"______________________________________________________________________"
_log
""
_log
""
_getFileSnapshot>
$snapShotCurrent
_getFileSnapshot>
$snapShotCurrent
if
[
$?
-ne
0
]
;
then
_log
"ABORT: Snapshot file is not writable
${
snapShotCurrent
}
."
ls
-l
"
${
snapShotCurrent
}
"
exit
1
fi
diff
$snapShotStart
$snapShotCurrent
>
/dev/null
diff
$snapShotStart
$snapShotCurrent
>
/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
_log
"ABORT: Files were updated / overwritten. The loop must be restarted.
\n
`
diff
$snapShotStart
$snapShotCurrent
`
"
_log
"ABORT: Files were updated / overwritten. The loop must be restarted.
\n
`
diff
$snapShotStart
$snapShotCurrent
`
"
...
...
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