libunwind: update to 1.8.1
[openadk.git] / package / rng-tools / files / rngd.init
blob740c5ead7f4491fc450f8e06ec24ca481c4fc0e2
1 #!/bin/sh
2 #PKG rng-tools
3 #INIT 60
4 . /etc/rc.conf
6 case $1 in
7 autostop) ;;
8 autostart)
9 test x"${rngd:-NO}" = x"NO" && exit 0
10 test x"$rngd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
11 exec sh $0 start
13 start)
14 devnode=""
15 for node in hw_random hwrandom i810_rng hwrng; do
16 if [ -e /dev/$node ]; then
17 devnode=/dev/$node
18 break
20 done
21 if [ -z "$devnode" ]; then
22 echo "no hardware RNG found, falling back to /dev/urandom"
23 devnode=/dev/urandom
25 /usr/sbin/rngd -b -r $devnode
27 stop)
28 kill $(pgrep -f /usr/sbin/rngd)
30 restart)
31 sh $0 stop
32 sleep 1
33 sh $0 start
36 echo "Usage: $0 {start | stop | restart}"
37 exit 1
39 esac
40 exit $?