Wait for enough entropy before generating keys

This commit is contained in:
Giulio 2020-09-19 15:11:31 +02:00
parent ac280d0490
commit 01bb05168d
2 changed files with 18 additions and 0 deletions

18
conf/etc/init.d/S22waitrng Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
case "$1" in
start)
status=`cat /proc/sys/kernel/random/entropy_avail`
echo "Waiting for enough entropy: "
while [ $status -lt 200 ]; do
sleep 2
status=`cat /proc/sys/kernel/random/entropy_avail`
done
echo -n "OK"
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit 0