ddstatus.sh: re-check dd each loop so it exits when dd finishes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 14:59:00 -04:00
co-authored by Claude Opus 5.5
parent 9f6a5ef551
commit f962a1bac5
+11 -13
View File
@@ -6,22 +6,20 @@ PID=$(pidof dd)
main(){ main(){
while true;do if [ -z "${PID}" ];then
clear
if [ ! ${PID} ];then
echo "DD is not running" echo "DD is not running"
exit 0; exit 0;
elif [[ ${PID} ]];then fi
kill -USR1 ${PID} > /dev/null
while true;do
clear
PID=$(pidof dd)
if [ -z "${PID}" ];then
echo "dd is no longer running"
exit 0;
fi
kill -USR1 ${PID} > /dev/null 2>&1
sleep 1 sleep 1
if [[ ! ${PID} ]];then
echo "dd it no longer running"
exit 0;
fi
else
echo "There was an unknown error, exiting..."
exit 0;
fi
done done
} }