3 # urandom This script saves the random seed between reboots.
4 # It is called from the boot, halt and reboot scripts.
6 # Version: @(#)urandom 1.33 22-Jun-1998 miquels@cistron.nl
9 [ -c /dev
/urandom
] ||
exit 0
14 if [ "$VERBOSE" != no
]
16 echo -n "Initializing random number generator... "
18 # Load and then save 512 bytes,
19 # which is the size of the entropy pool
20 if [ -f /etc
/random-seed
]
22 cat /etc
/random-seed
>/dev
/urandom
24 rm -f /etc
/random-seed
26 dd if=/dev
/urandom of
=/etc
/random-seed count
=1 \
27 >/dev
/null
2>&1 ||
echo "urandom start: failed."
29 [ "$VERBOSE" != no
] && echo "done."
32 # Carry a random seed from shut-down to start-up;
33 # see documentation in linux/drivers/char/random.c
34 [ "$VERBOSE" != no
] && echo -n "Saving random seed... "
36 dd if=/dev
/urandom of
=/etc
/random-seed count
=1 \
37 >/dev
/null
2>&1 ||
echo "urandom stop: failed."
38 [ "$VERBOSE" != no
] && echo "done."
41 echo "Usage: urandom {start|stop}" >&2
This page took 0.045194 seconds and 5 git commands to generate.