1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

Use anticongestion in security/rkhunter

Introduced in src r316342, the anticongestion feature unifies multiple periodic
scripts' disparate sleeps.

PR:		218446
Submitted by:	lukasz@wasikowski.net
Reported by:	asomers
Reviewed by:	asomers
Approved by:	Lukasz Wasikowski <lukasz@wasikowski.net> (maintainer)
Approved by:	brd (ports)
This commit is contained in:
Alan Somers 2017-05-20 02:59:01 +00:00
parent cd26188ac1
commit d308cd0fcc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=441287
2 changed files with 18 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= rkhunter
PORTVERSION= 1.4.2
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= SF

View File

@ -16,6 +16,13 @@ if [ -r /etc/defaults/periodic.conf ]; then
source_periodic_confs
fi
SLEEP=/bin/sleep
JOT=/usr/bin/jot
random() {
${JOT} -r 1 0 900
}
: ${daily_rkhunter_update_flags="--update --nocolors"}
: ${daily_rkhunter_check_flags="--checkall --nocolors --skip-keypress"}
@ -24,6 +31,16 @@ case "$daily_rkhunter_update_enable" in
echo ""
echo "Updating the rkhunter database..."
# When non-interactive, sleep to reduce congestion on rkhunter site
if [ "$1" != -nodelay ]; then
# In FreeBSD 12.0 the anticongestion function should be used
# instead of a hard-coded sleep
if [ -n "$anticongestion_sleeptime" ]; then
anticongestion
else
${SLEEP} $(random)
fi
fi
%%PREFIX%%/bin/rkhunter ${daily_rkhunter_update_flags}
;;
esac