]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/random
network-vlans: Provide a better configuation file.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / random
1 #!/bin/sh
2 # Begin $rc_base/init.d/random
3
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
7
8 . /etc/sysconfig/rc
9 . $rc_functions
10
11 case "$1" in
12 start)
13 boot_mesg "Initializing kernel random number generator..."
14 if [ -f /var/tmp/random-seed ]; then
15 /bin/cat /var/tmp/random-seed >/dev/urandom
16 else
17 /bin/dd if=/dev/random of=/dev/urandom \
18 count=1 &>/dev/null
19 fi
20 /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
21 count=1 &>/dev/null
22 evaluate_retval
23 ;;
24
25 stop)
26 boot_mesg "Saving random seed..."
27 /bin/dd if=/dev/urandom of=/var/tmp/random-seed \
28 count=1 &>/dev/null
29 evaluate_retval
30 ;;
31
32 *)
33 echo "Usage: $0 {start|stop}"
34 exit 1
35 ;;
36 esac
37
38 # End $rc_base/init.d/random