From: Razvan Deaconescu Date: Mon, 20 Sep 2010 18:01:51 +0000 (+0200) Subject: next-share: complete next-share completion detection script X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=dc3ca0c10a1d115df792647830c452a481ca0af5;p=p2p-testing-infrastructure.git next-share: complete next-share completion detection script --- diff --git a/ControlScripts/clients/next-share/detect_complete_nextshare.sh b/ControlScripts/clients/next-share/detect_complete_nextshare.sh index e828197..3d54a83 100755 --- a/ControlScripts/clients/next-share/detect_complete_nextshare.sh +++ b/ControlScripts/clients/next-share/detect_complete_nextshare.sh @@ -20,10 +20,25 @@ fi LOG_FILE=$1 while true; do - if cat $LOG_FILE | grep DLSTATUS_SEEDING &> /dev/null; then + # check for complete transfer + if cat $LOG_FILE | grep "DLSTATUS_SEEDING" &> /dev/null; then + echo "Torrent transfer finished" exit 0 fi - + + if cat $LOG_FILE | grep "Segmentation fault" &> /dev/null; then + echo "Segmentation fault when transferring torrent" + exit 0 + fi + + # check stat client is alive + if ! pgrep -f "cmdlinedl.py" &> /dev/null; then + if ! pgrep -f "schedule_client.sh" &> /dev/null; then + echo "No cmdlinedl.py and no schedule_client.sh process" + exit 0 + fi + fi + # Don't do continuous polling sleep 5 done