<div dir="ltr"><div dir="ltr">On Thu, Jan 6, 2022 at 2:15 PM John Sellens <<a href="mailto:jsellens@syonex.com">jsellens@syonex.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">To accomplish your goal, I suspect you have to run smartctl to query<br>
the test's progress e.g. something like this:<br>
    while true ; do<br>
        smartctl -a /dev/sda | grep -q 'Self-test routing in progress'<br>
        if [ $? -ne 0 ]; then<br>
            echo test finished<br>
            break<br>
        fi<br>
    done</blockquote><div><br></div><div>Or more concisely ... <br></div><div><br></div><div>watch -n5 "smartctl -a /dev/sda | grep -q 'Self-test routing in progress'" <br></div></div></div>