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

packages2install: put filtered view into function

parent 0b709ee7
No related branches found
No related tags found
No related merge requests found
......@@ -180,41 +180,11 @@ function checkYum(){
echo
}
# ----------------------------------------------------------------------
# main
# ----------------------------------------------------------------------
# set default / override from command line params
typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"`
typeset -i iCriticalLimit=` ph.getValueWithParam 200 c "$@"`
# ----- try package manager apt
pgkman=$( detectPkgManager )
case $pgkman in
"apt")
pkgstatus=$( checkApt )
pkgsum=$( pkgApt )
;;
"pamac")
pkgstatus=""
pkgsum=$( pkgPamac )
;;
"yum")
pkgstatus=$( checkYum )
pkgsum=$( pkgYum )
;;
*)
ph.abort "UNKNOWN: package manager [$pgkman] was not detected or is not supported yet."
;;
esac
echo "$pkgstatus"
echo
showAutoupdate
echo
# show grouped packages by category
# OOPS: uses global vars :-/
function showFilteredPackages(){
# filtered package view
if [ ! -z "$pkgsum" ]; then
......@@ -251,6 +221,43 @@ if [ ! -z "$pkgsum" ]; then
fi
}
# ----------------------------------------------------------------------
# main
# ----------------------------------------------------------------------
# set default / override from command line params
typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"`
typeset -i iCriticalLimit=` ph.getValueWithParam 200 c "$@"`
# ----- try package manager apt
pgkman=$( detectPkgManager )
case $pgkman in
"apt")
pkgstatus=$( checkApt )
pkgsum=$( pkgApt )
;;
"pamac")
pkgstatus=""
pkgsum=$( pkgPamac )
;;
"yum")
pkgstatus=$( checkYum )
pkgsum=$( pkgYum )
;;
*)
ph.abort "UNKNOWN: package manager [$pgkman] was not detected or is not supported yet."
;;
esac
echo "$pkgstatus"
echo
showAutoupdate
echo
showFilteredPackages
ph.exit
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment