ec(2); $count = 0; while(true) { system('ping qq.com', $retval); if(!$retval) { break; } else { $count ++; } if($count > 10) { system('shutdown -s -t 60 -f -c "网络不通,60s后关机"', $retval); } }