Skip to content

Instantly share code, notes, and snippets.

@reboot81
Created July 27, 2025 23:19
Show Gist options
  • Save reboot81/a07506c5be857d89f540fd0427d768b5 to your computer and use it in GitHub Desktop.
Save reboot81/a07506c5be857d89f540fd0427d768b5 to your computer and use it in GitHub Desktop.
Unraid awake if Parity-Check in progress
# Abort sleep if a parity check is in progress
if awk -F= '/mdResync(Pos|Size)/ { a[$1]=$2 } END { exit !(a["mdResyncSize"] > 0 && a["mdResyncPos"] < a["mdResyncSize"]) }' /proc/mdstat; then
logger "Parity check in progress – skipping sleep"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment