Wait until the PID file is gone.
[utils.git] / autodlctl
index 78ef0e6..1215c65 100755 (executable)
--- a/autodlctl
+++ b/autodlctl
@@ -182,6 +182,10 @@ while [ "$done" != y ]; do
                        pid="`cat "$HOME/dc/autodl/run/$tag"`"
                        echo "sending SIGUSR1 to $pid"
                        kill -USR1 "$pid"
+                       while [ -e "$HOME/dc/autodl/run/$tag" ]; do
+                           echo "waiting for it to exit"
+                           sleep 1
+                       done
                    else
                        echo "could not find pid for $tag"
                    fi