aboutsummarylogtreecommitdiffstats
path: root/systemd-report-entropy
blob: 482d32db03a5a54af3394b57d8c68450807dc420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
while true; do
  entropy=$(cat /proc/sys/kernel/random/entropy_avail)
  echo -n "At $(date -Ins) ENTROPY $entropy"
  sleepms=$(echo "$(( $entropy < 100 ? 100 : $entropy )) / 10" | bc -l)
  echo -e " sleeping $sleepms ms"
  sleep $(echo "$sleepms / 1000" | bc -l)
  is_running=$(systemctl is-system-running)
  echo "is-system-running: $is_running"
  if [[ $is_running != initializing && $is_running != starting ]]; then
    echo "REPORT ENTROPY systemd boot finished, quit."
    exit
  fi
done