diff options
author | Roy Marples <roy@marples.name> | 2007-11-23 12:04:11 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-11-23 12:04:11 +0000 |
commit | d81def80b00a3dbcb4f8980f4503c4d659b48a2a (patch) | |
tree | 64a5df4281620cacbc1f03838d42e88167886fc9 /init.d/urandom | |
parent | f077f179edaeb746b267421baa29ec751c38b713 (diff) |
Move /etc/conf.d/rc to /etc/rc.conf.
Lowercase all configurable variables, non configurations remain uppercase.
Replace rc_env_bool with rc_yesno.
Split localmount info procfs (Linux) and dumpon, savecore (BSD)
Diffstat (limited to 'init.d/urandom')
-rwxr-xr-x | init.d/urandom | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/init.d/urandom b/init.d/urandom index c5e41d03..9a03068b 100755 --- a/init.d/urandom +++ b/init.d/urandom @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -URANDOM_SEED=${URANDOM_SEED:-/var/run/random-seed} +urandom_seed=${urandom_seed:-${URANDOM_SEED:-/var/run/random-seed}} description="Initializes the random number generator." @@ -41,22 +41,19 @@ save_seed() { ( # sub shell to prevent umask pollution umask 077 - dd if=/dev/urandom of="${URANDOM_SEED}" count=${poolsize} 2>/dev/null + dd if=/dev/urandom of="${urandom_seed}" count=${poolsize} 2>/dev/null ) } start() { [ -c /dev/urandom ] || return - if [ -f "${URANDOM_SEED}" ] ; then - cat "${URANDOM_SEED}" > /dev/urandom + if [ -f "${urandom_seed}" ] ; then + ebegin "Initializing random number generator" + cat "${urandom_seed}" > /dev/urandom + eend $? "Error initializing random number generator" fi - if ! rm -f "${URANDOM_SEED}" ; then - ewarn "Skipping ${URANDOM_SEED} initialization (ro root?)" - return 0 - fi - ebegin "Initializing random number generator" - save_seed - eend $? "Error initializing random number generator" + rm -f "${urandom_seed}" && save_seed + return 0 } stop() { |