random-seed (532B)
1 #!/usr/bin/execlineb -S1 2 # Use execlineb -WS1 for debug/testing (errors out on bad syntax) 3 4 case -N -- $1 5 { 6 "-s" { 7 foreground { printf "Setting random seed...\n" } 8 foreground { 9 if { eltest -f /etc/random-seed } 10 redirfd -w 1 /dev/urandom { cat /etc/random-seed } 11 } 12 exec dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 13 } 14 15 "-k" { 16 foreground { printf "Storing random seed...\n" } 17 exec dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 18 } 19 } foreground { /usr/bin/printf "usage: %s -s|-k\n" "$0" } exit 1