mirror of https://github.com/CISOfy/lynis.git
Add scheduler[] and minor cleanups
This commit is contained in:
parent
448fd65e31
commit
4791b8a6bf
|
@ -41,7 +41,8 @@
|
||||||
else
|
else
|
||||||
LogText "Result: cron daemon running"
|
LogText "Result: cron daemon running"
|
||||||
CROND_RUNNING=1
|
CROND_RUNNING=1
|
||||||
report "crond_running=1"
|
Report "crond_running=1"
|
||||||
|
Report "scheduler[]=crond"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
@ -51,10 +52,9 @@
|
||||||
# Description : Check crontab / cronjobs
|
# Description : Check crontab / cronjobs
|
||||||
Register --test-no SCHD-7704 --weight L --network NO --description "Check crontab/cronjobs"
|
Register --test-no SCHD-7704 --weight L --network NO --description "Check crontab/cronjobs"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
FindCronJob()
|
FindCronJob() {
|
||||||
{
|
|
||||||
sCRONJOBS=`egrep '^([0-9*])' $1 | tr '\t' ' ' | tr -s ' ' | tr ' ' ','`
|
sCRONJOBS=`egrep '^([0-9*])' $1 | tr '\t' ' ' | tr -s ' ' | tr ' ' ','`
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -f /etc/crontab ]; then
|
if [ -f /etc/crontab ]; then
|
||||||
FindCronJob /etc/crontab
|
FindCronJob /etc/crontab
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
FindCronJob ${J}
|
FindCronJob ${J}
|
||||||
for K in ${sCRONJOBS}; do
|
for K in ${sCRONJOBS}; do
|
||||||
LogText "Result: Found cronjob (${I}): ${K}"
|
LogText "Result: Found cronjob (${I}): ${K}"
|
||||||
|
Report "cronjob[]=${J}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
LogText "Result: done with analyzing files in ${I}"
|
LogText "Result: done with analyzing files in ${I}"
|
||||||
|
@ -144,10 +145,13 @@
|
||||||
if [ -f /etc/anacrontab ]; then
|
if [ -f /etc/anacrontab ]; then
|
||||||
LogText "Test: checking anacrontab"
|
LogText "Test: checking anacrontab"
|
||||||
sANACRONJOBS=`egrep '^([0-9@])' /etc/anacrontab | tr '\t' ' ' | tr -s ' ' | tr ' ' ','`
|
sANACRONJOBS=`egrep '^([0-9@])' /etc/anacrontab | tr '\t' ' ' | tr -s ' ' | tr ' ' ','`
|
||||||
for J in ${sANACRONJOBS}; do
|
if [ ! "${sANACRONJOBS}" = "" ]; then
|
||||||
LogText "Found anacron job (/etc/anacrontab): ${J}"
|
Report "scheduler[]=anacron"
|
||||||
Report "cronjob[]=${J}"
|
for J in ${sANACRONJOBS}; do
|
||||||
done
|
LogText "Found anacron job (/etc/anacrontab): ${J}"
|
||||||
|
Report "cronjob[]=${J}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -166,9 +170,10 @@
|
||||||
LogText "Result: at daemon active"
|
LogText "Result: at daemon active"
|
||||||
Display --indent 2 --text "- Checking atd status" --result RUNNING --color GREEN
|
Display --indent 2 --text "- Checking atd status" --result RUNNING --color GREEN
|
||||||
ATD_RUNNING=1
|
ATD_RUNNING=1
|
||||||
|
Report "scheduler[]=atd"
|
||||||
else
|
else
|
||||||
LogText "Result: at daemon not active"
|
LogText "Result: at daemon not active"
|
||||||
Display --indent 2 --text "- Checking atd status" --result "NOT RUNNING" --color WHITE
|
if IsVerbose; then Display --indent 2 --text "- Checking atd status" --result "NOT RUNNING" --color WHITE; fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue