#!/bin/sh
# seedrng loads the stored seed, credits it to the kernel pool and writes a
# fresh one straight away, so an unclean shutdown can never leave two boots
#
# this should also create and set permissions on /var/lib/seedrng all by itself
. /usr/lib/nitro/rc.lib
case $1 in
up)
    log "seeding the kernel rng..."
    seedrng || log "warning: seedrng failed"
    ;;
down)
    log "saving the rng seed..."
    seedrng || :
    ;;
esac
exit 0
