mirror of https://github.com/CISOfy/lynis.git
Merge pull request #1263 from pyllyukko/needs_restarting
KRNL-5830: Check for /var/run/needs_restarting
This commit is contained in:
commit
a0e9e3d363
|
@ -615,25 +615,29 @@
|
||||||
Register --test-no KRNL-5830 --os Linux --weight L --network NO --category security --description "Checking if system is running on the latest installed kernel"
|
Register --test-no KRNL-5830 --os Linux --weight L --network NO --category security --description "Checking if system is running on the latest installed kernel"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
REBOOT_NEEDED=2
|
REBOOT_NEEDED=2
|
||||||
FILE="${ROOTDIR}var/run/reboot-required.pkgs"
|
for FILE in "${ROOTDIR}var/run/reboot-required.pkgs" "${ROOTDIR}var/run/needs_restarting"
|
||||||
LogText "Test: Checking presence ${FILE}"
|
do
|
||||||
if [ -f ${FILE} ]; then
|
LogText "Test: Checking presence ${FILE}"
|
||||||
LogText "Result: file ${FILE} exists"
|
if [ -f ${FILE} ]; then
|
||||||
FIND=$(${WCBINARY} -l < ${FILE})
|
LogText "Result: file ${FILE} exists"
|
||||||
if [ "${FIND}" = "0" ]; then
|
FIND=$(${WCBINARY} -l < ${FILE})
|
||||||
LogText "Result: No reboot needed (file empty)"
|
if [ "${FIND}" = "0" ]; then
|
||||||
REBOOT_NEEDED=0
|
LogText "Result: No reboot needed (file empty)"
|
||||||
|
REBOOT_NEEDED=0
|
||||||
|
break
|
||||||
|
else
|
||||||
|
PKGSCOUNT=$(${WCBINARY} -l < ${FILE})
|
||||||
|
LogText "Result: reboot is needed, related to ${PKGSCOUNT} packages"
|
||||||
|
for I in ${FIND}; do
|
||||||
|
LogText "Package: ${I}"
|
||||||
|
done
|
||||||
|
REBOOT_NEEDED=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PKGSCOUNT=$(${WCBINARY} -l < ${FILE})
|
LogText "Result: file ${FILE} not found"
|
||||||
LogText "Result: reboot is needed, related to ${PKGSCOUNT} packages"
|
|
||||||
for I in ${FIND}; do
|
|
||||||
LogText "Package: ${I}"
|
|
||||||
done
|
|
||||||
REBOOT_NEEDED=1
|
|
||||||
fi
|
fi
|
||||||
else
|
done
|
||||||
LogText "Result: file ${FILE} not found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if /boot exists
|
# Check if /boot exists
|
||||||
if [ -d "${ROOTDIR}boot" ]; then
|
if [ -d "${ROOTDIR}boot" ]; then
|
||||||
|
|
Loading…
Reference in New Issue