rngd: update initskript and add hwrngtty support
[ipfire-2.x.git] / src / initscripts / system / rngd
index 91b70a7..0f95fde 100644 (file)
 
 case "${1}" in
        start)
+               if pidofproc -s /usr/sbin/rngd; then
+                       boot_mesg "Random Number Generator Daemon is already running..."
+                       echo_ok;
+                       exit 0
+               fi
+               if [ -e /dev/hwrngtty ]; then
+                       HWRNG=/dev/hwrngtty
+               else
+                       HWRNG=/dev/hwrng
+               fi
                boot_mesg "Starting Random Number Generator Daemon..."
-               loadproc /usr/sbin/rngd --quiet
+               loadproc /usr/sbin/rngd -r $HWRNG --quiet
                ;;
 
        stop)