mirror of https://github.com/CISOfy/lynis.git
Merge pull request #141 from kboratynski/features/macosx_brew
Added brew as package manager.
This commit is contained in:
commit
30dae85a63
|
@ -32,6 +32,9 @@
|
||||||
#
|
#
|
||||||
Display --indent 2 --text "- Searching package managers"
|
Display --indent 2 --text "- Searching package managers"
|
||||||
|
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
|
#
|
||||||
# Test : PKGS-7301
|
# Test : PKGS-7301
|
||||||
# Description : Query FreeBSD pkg
|
# Description : Query FreeBSD pkg
|
||||||
if [ -x /usr/sbin/pkg ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
if [ -x /usr/sbin/pkg ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
|
@ -80,6 +83,29 @@
|
||||||
done
|
done
|
||||||
Report "installed_packages=${N}"
|
Report "installed_packages=${N}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
|
#
|
||||||
|
# Test : PKGS-7303
|
||||||
|
# Description : Query brew package manager
|
||||||
|
if [ `type -p brew` ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
|
Register --test-no PKGS-7303 --preqs-met ${PREQS_MET} --weight L --network NO --description "Query brew package manager"
|
||||||
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
|
Display --indent 4 --text "- Searching brew" --result FOUND --color GREEN
|
||||||
|
LogText "Result: Found brew"
|
||||||
|
Report "package_manager[]=brew"
|
||||||
|
LogText "Test: Querying brew to get package list"
|
||||||
|
Display --indent 4 --text "- Querying brew for installed packages"
|
||||||
|
LogText "Output:"; LogText "-----"
|
||||||
|
GPACKAGES=`brew list`
|
||||||
|
for J in ${GPACKAGES}; do
|
||||||
|
LogText "Found package ${J}"
|
||||||
|
INSTALLED_PACKAGES="${INSTALLED_PACKAGES}|${J}"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
LogText "Result: brew can NOT be found on this system"
|
||||||
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue