HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: //etc/rc.d/postrandom
#!/bin/sh
#
# $FreeBSD: releng/10.3/etc/rc.d/postrandom 240336 2012-09-11 05:04:59Z obrien $
#

# PROVIDE: postrandom
# REQUIRE: initrandom random FILESYSTEMS
# BEFORE: LOGIN
# KEYWORD: nojail

. /etc/rc.subr

name="postrandom"
start_cmd="${name}_start"
stop_cmd=":"

# This will remove old ${entropy_file} and generate a new one.
# According to Bruce Schneier, this is strongly recommended in order
# to avoid using same ${entropy_file} across reboots.
# Reference: Chapter 10.6, Practical Cryptography, ISBN: 0-471-22357-3

postrandom_start()
{
	/etc/rc.d/random fastsaveseed

	case ${entropy_dir} in
	[Nn][Oo])
		;;
	*)
		entropy_dir=${entropy_dir:-/var/db/entropy}
		if [ -d "${entropy_dir}" ]; then
			if [ -w /dev/random ]; then
				rm -f ${entropy_dir}/*
			fi
		fi
		;;
	esac
}

load_rc_config random
run_rc_command "$1"