summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/rng-tools/files/rngd')
-rw-r--r--sys-apps/rng-tools/files/rngd30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-apps/rng-tools/files/rngd b/sys-apps/rng-tools/files/rngd
new file mode 100644
index 000000000000..738f8fe63068
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/rng-tools/files/rngd,v 1.1 2003/08/20 14:06:58 hanno Exp $
+
+depend() {
+ need localmount
+ after random
+}
+
+start() {
+ ebegin "Starting hardware RNG daemon"
+ if [ -e /dev/hwrandom ]; then
+ start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -b -r /dev/hwrandom
+ eend $? "Failed to start hardware RNG daemon"
+ elif [ -e /dev/i810_rng ]; then
+ start-stop-daemon --start --quiet --exec /usr/sbin/rngd -- -b -r /dev/i810_rng
+ eend $? "Failed to start hardware RNG daemon"
+ else
+ eerror "No hardware RNG found!"
+ return 1
+ fi
+}
+
+stop() {
+ ebegin "Stopping hardware RNG daemon"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/rngd
+ eend $? "Failed to stop hardware RNG daemon"
+}
+