* Fixed problem when BASEDIR paths were given without a trailing '/'.
[linux_from_scratch.git] / bootscripts / blfs / init.d / random
blob2755bfc3ca5b3c3bce4f3c60494a35405b10bce8
1 #!/bin/sh
2 # Begin $rc_base/init.d/random
4 # Based on sysklogd script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6 # Random script elements by Larry Lawrence
8 . /etc/sysconfig/rc
9 . $rc_functions
11 case "$1" in
12 start)
13 echo "Initializing kernel random number generator..."
14 if [ -f /var/tmp/random-seed ]; then
15 cat /var/tmp/random-seed >/dev/urandom
17 dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
18 evaluate_retval
21 stop)
22 echo "Saving random seed..."
23 dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
24 evaluate_retval
28 echo "Usage: $0 {start|stop}"
29 exit 1
31 esac
33 # End $rc_base/init.d/random