ControlScripts: add message output to hrk complete detection script
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 14:47:31 +0000 (17:47 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 6 Aug 2010 14:51:12 +0000 (17:51 +0300)
ControlScripts/detect_complete_hrk.sh

index c8229d4..93dfaa7 100755 (executable)
@@ -28,12 +28,16 @@ LOG_FILE=$1
 while true; do
        # check for complete transfer
        if cat $LOG_FILE | grep "Torrent finished" &> /dev/null; then
+               echo "Torrent transfer finished"
                exit 0
        fi
 
        # check stat client is alive
        if ! pgrep "hrktorrent" &> /dev/null; then
-               exit 0
+               if ! pgrep -f "schedule_client.sh" &> /dev/null; then
+                       echo "No hrktorrent and no schedule_client.sh process"
+                       exit 0
+               fi
        fi
 
        # Don't do continuous polling