[main]
@type = oneshot
@version = @vers@
@description = "Create random seed"
@user = ( root )
@depends = ( 00 )
@options = ( !log )

[start]
@execute =
(
    if { 66-yeller -cdp system-random -1 /dev/console starts... }
    if -nt {

        if -t { execl-toc -X -r /var/lib/random-seed }
        redirfd -w 1 /dev/urandom
        cat /var/lib/random-seed

    }
    66-yeller -fcdp system-random -1 /dev/console crashed!

)

[stop]
@execute=
(
    if { 66-yeller -cdp system-random -1 /dev/console stops... }
    if -nt {

        umask 0077
        backtick -nD "512" -- bytes {
            cat /proc/sys/kernel/random/poolsize
        }
        importas -iu bytes bytes
        dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=${bytes} status=none

    }
    66-yeller -fcdp system-random -1 /dev/console crashed!
)
