diff --git a/web/clitools/crawler.php b/web/clitools/crawler.php index b0a6031..3a9b155 100755 --- a/web/clitools/crawler.php +++ b/web/clitools/crawler.php @@ -278,6 +278,7 @@ if ($restore) { shuffle($insts); $cinsts=count($insts); eecho(1,$cinsts.' instances to be checked.'.N); + if ($cinsts==0) mexit('nothing to do, bye.'.N,0,true); $instsf=@fopen($instsjfp,'w'); if ($instsf===false) mexit('could not open «'.$instsjfp.'» for writing.'.N,1,true); @@ -330,7 +331,7 @@ do { } } } - $out=$done.'/'.$cinsts.' ('.round(100/$cinsts*$done).'%); elapsed time: '.ght($tet,null,0); + $out=$done.'/'.$cinsts.' ('.round(100*$done/$cinsts).'%); elapsed time: '.ght($tet,null,0); if ($done>0) $out.='; estimated time remaining: '.ght($cinsts*$tet/$done-$tet,null,0); eecho(1,$out.'.'.N); if ($somerun) {