aboutsummaryrefslogtreecommitdiff
path: root/system/bit-babbler/rc.seedd
diff options
context:
space:
mode:
Diffstat (limited to 'system/bit-babbler/rc.seedd')
-rw-r--r--system/bit-babbler/rc.seedd41
1 files changed, 41 insertions, 0 deletions
diff --git a/system/bit-babbler/rc.seedd b/system/bit-babbler/rc.seedd
new file mode 100644
index 0000000000000..de304c37b6ae9
--- /dev/null
+++ b/system/bit-babbler/rc.seedd
@@ -0,0 +1,41 @@
+#!/bin/sh
+# /etc/rc.d/rc.seedd: start and stop BitBabbler TRNG(s).
+#
+# Revised 2 October 2015, AWG
+
+seedd_start() {
+ if [ -S /var/run/bit-babbler/seedd.socket ]; then
+ echo 'seedd appears to be already running!'
+ else
+ echo 'Checking for BitBabbler(s)...'
+ /usr/bin/seedd --scan
+ echo 'Starting seedd: /usr/bin/seedd --daemon --kernel'
+ /usr/bin/seedd --daemon --kernel
+ fi
+}
+
+seedd_stop() {
+ echo 'Stopping seedd...'
+ killall -w seedd
+ rm -f /var/run/bit-babbler/seedd.socket.lock
+}
+
+seedd_restart() {
+ seedd_stop
+ sleep 2
+ seedd_start
+}
+
+case "$1" in
+'start')
+ seedd_start
+ ;;
+'stop')
+ seedd_stop
+ ;;
+'restart')
+ seedd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac