Skip to content
Snippets Groups Projects
Commit dc594b9c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update yum command

parent 914bcb31
No related branches found
No related tags found
No related merge requests found
...@@ -156,16 +156,23 @@ function checkYum(){ ...@@ -156,16 +156,23 @@ function checkYum(){
# summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>&1 | fgrep 'security'" ` # summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>&1 | fgrep 'security'" `
# summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>&1 | fgrep 'security'" ` # summary=`ph.execIfReady "/usr/bin/yum --security check-update 2>&1 | fgrep 'security'" `
ph.execIfReady "sudo /usr/bin/yum --security check-update > $_yumout 2>&1"
local summary=$( cat $_yumout | grep security )
# ph.execIfReady "sudo /usr/bin/yum --security check-update > $_yumout 2>&1"
# local summary=$( cat $_yumout | grep security )
local summary=$( /usr/bin/yum --bugfix check-update 2>&1 | grep security )
test -z "$summary" && summary='no data .. no packages to install' test -z "$summary" && summary='no data .. no packages to install'
# example outputs: # example outputs:
# I No packages needed for security; 223 packages available # I No packages needed for security; 223 packages available
# II 2 package(s) needed for security, out of 237 available # II 2 package(s) needed for security, out of 237 available
typeset -i local iPkgSecurity=` echo $summary | cut -f 1 -d ' ' | sed "s#[^0-9]##g"` # III No security updates needed, but 61 updates available << centos 8 stream
typeset -i local iPkg2Update=` echo $summary | cut -f 2- -d ' ' | sed "s#[^0-9]##g"` typeset -i local iPkgSecurity
iPkgSecurity=$( echo "$summary" | cut -f 1 -d ' ' | sed "s#[^0-9]##g")
typeset -i local iPkg2Update
iPkg2Update=$( echo "$summary" | cut -f 2- -d ' ' | sed "s#[^0-9]##g")
# step I: check limits with packages to update: # step I: check limits with packages to update:
ph.setStatusByLimit ${iPkg2Update} ${iWarnLimit} ${iCriticalLimit} ph.setStatusByLimit ${iPkg2Update} ${iWarnLimit} ${iCriticalLimit}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment