Last active
June 6, 2021 23:57
-
-
Save za3k/64faa4aa0a9ecb338a8af8b0569fccb6 to your computer and use it in GitHub Desktop.
onerng.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ONERNG=/dev/ttyACM0 | |
t=onerng.out | |
stty -F $ONERNG raw -echo clocal -crtscts | |
echo "cmd0" >$ONERNG # standard noise | |
echo "cmdO" >$ONERNG # turn it on | |
stty -F $ONERNG raw -echo clocal -crtscts | |
gone() { | |
echo "cmdo" >$ONERNG # turn it off | |
echo "cmd4" >$ONERNG # turn off noise gathering | |
echo "cmdw" >$ONERNG # flush entropy pool | |
} | |
trap gone EXIT SIGINT SIGTERM SIGHUP | |
dd if=$ONERNG iflag=fullblock bs=1k "$@" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment