Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
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
icinga-checks
Merge requests
!20
add sudo when calling yum
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add sudo when calling yum
5419-update-check-packages2install
into
master
Overview
0
Commits
3
Pipelines
0
Changes
4
Merged
Hahn Axel (hahn)
requested to merge
5419-update-check-packages2install
into
master
3 years ago
Overview
0
Commits
3
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Compare
master
version 1
05b8d8f9
3 years ago
master (base)
and
latest version
latest version
6cd526a7
3 commits,
3 years ago
version 1
05b8d8f9
1 commit,
3 years ago
4 files
+
36
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
check_packages2install-pkgmanager/apt.sh
+
6
−
6
Options
@@ -9,27 +9,27 @@
# ---------------------------------------------------------------
# ah <axel.hahn@iml.unibe.ch>
# 2022-06-03 v1.0 ah first version
# 2022-06-07 v1.1 ah remove text "Nothing to install"
# rename functions
# ===============================================================
# ---------------------------------------------------------------
# command to list of updates
function
apt
G
etUpdates
(){
function
apt
.g
etUpdates
(){
sudo
apt-get
-u
upgrade
--assume-no
}
# ---------------------------------------------------------------
# extract list of packages 2 install
# global string packagemanOut output of update lister command
function
aptPackage
s
(){
function
apt
.get
Package
List
(){
# detect number of line containing "The following packages will be upgraded:"
typeset
-i
local
iStart
iStart
=
$(
echo
"
$packagemanOut
"
|
grep
-n
'^The following packages will be upgraded:'
|
cut
-f
1
-d
':'
)
if
[
$iStart
-eq
0
]
;
then
echo
"Nothing to install"
else
if
[
$iStart
-gt
0
]
;
then
# show packages = text starting with 2 spaces below start line
# packages are delimited with space -> replace with new line
echo
"
$packagemanOut
"
|
sed
-n
$iStart
,
\$
p |
grep
"^
\ \
"
|
sed
"s#^
\ \
##g"
|
tr
" "
"
\n
"
@@ -39,7 +39,7 @@ function aptPackages(){
# ---------------------------------------------------------------
# get status line on apt based systems (debian, ubuntu)
# global string packagemanOut output of update lister command
function
aptStatus
(){
function
apt
.get
Status
Line
(){
echo
"
$packagemanOut
"
|
grep
"upgraded.*installed"
}
Loading