Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Check DNF Automatic
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tier 2
monitoring-plugins
Check DNF Automatic
Commits
cf920b20
Commit
cf920b20
authored
6 months ago
by
Meisam Farzalipour Tabriz
Browse files
Options
Downloads
Patches
Plain Diff
fix scripts format
parent
816653a5
No related branches found
No related tags found
No related merge requests found
Pipeline
#259064
passed
6 months ago
Stage: validate
Stage: test
Stage: build
Stage: install
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/check_dnf_automatic
+24
-29
24 additions, 29 deletions
script/check_dnf_automatic
tests/dnf-automatic-mock
+6
-7
6 additions, 7 deletions
tests/dnf-automatic-mock
with
30 additions
and
36 deletions
script/check_dnf_automatic
+
24
−
29
View file @
cf920b20
...
@@ -13,20 +13,17 @@
...
@@ -13,20 +13,17 @@
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
# =======================================================================================================================================
# =======================================================================================================================================
_version
=
"0.5"
_version
=
"0.5"
_requirements
=(
'dnf-automatic'
'tail'
'sed'
)
_requirements
=(
'dnf-automatic'
'tail'
'sed'
)
declare
-A
_exit_code
declare
-A
_exit_code
_exit_code[OK]
=
"0"
_exit_code[OK]
=
"0"
_exit_code[WARNING]
=
"1"
_exit_code[WARNING]
=
"1"
_exit_code[CRITICAL]
=
"2"
_exit_code[CRITICAL]
=
"2"
_exit_code[UNKNOWN]
=
"3"
_exit_code[UNKNOWN]
=
"3"
print_help
()
print_help
()
{
{
printf
'%s\n'
"This script checks the status of dnf-automatic."
printf
'%s\n'
"This script checks the status of dnf-automatic."
printf
'Usage: %s [--only-security] [--version] [-h|--help]\n'
"
$0
"
printf
'Usage: %s [--only-security] [--version] [-h|--help]\n'
"
$0
"
printf
'\t%s\n'
"--only-security: Do not issue a warning for non-security updates"
printf
'\t%s\n'
"--only-security: Do not issue a warning for non-security updates"
...
@@ -34,10 +31,8 @@ print_help()
...
@@ -34,10 +31,8 @@ print_help()
printf
'\t%s\n'
"-h, --help: Print help (this text!)"
printf
'\t%s\n'
"-h, --help: Print help (this text!)"
}
}
parse_commandline
()
parse_commandline
()
{
{
while
test
$#
-gt
0
;
do
while
test
$#
-gt
0
do
_key
=
"
$1
"
_key
=
"
$1
"
case
"
$_key
"
in
case
"
$_key
"
in
--only-security
)
--only-security
)
...
...
...
...
This diff is collapsed.
Click to expand it.
tests/dnf-automatic-mock
+
6
−
7
View file @
cf920b20
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
# dnf-automatic-mock --updates-available
# dnf-automatic-mock --updates-available
# dnf-automatic-mock --no-updates
# dnf-automatic-mock --no-updates
_output_type
=
"
$1
"
_output_type
=
"
$1
"
_test_dir
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&>/dev/null
&&
pwd
)
_test_dir
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&>/dev/null
&&
pwd
)
...
...
...
...
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
sign in
to comment