#!/bin/sh /etc/rc.common
# Copyright (C) 2011-2014 OpenWrt.org

START=98

RNGD_STEP=256
RNGD_AMOUNT=2048
RNGD_DEVICE="/dev/urandom"

start() {
        if [ -e /dev/hwrng ]; then
                RNGD_DEVICE="/dev/hwrng"
        fi
        service_start /sbin/rngd -r $RNGD_DEVICE -W $RNGD_AMOUNT -s $RNGD_STEP
}

stop() {
	service_stop /sbin/rngd
}

restart() {
	stop
	start
}
