slackbuilds_ponce/system/bit-babbler/rc.seedd.new
Arthur W. Green d20e4d268a
system/bit-babbler: Updated for version 0.6.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
2016-12-03 07:17:45 +07:00

41 lines
706 B
Bash

#!/bin/sh
# /etc/rc.d/rc.seedd: start and stop BitBabbler TRNG(s).
#
# Revised 1 November 2016
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