Advertisement
chan15

KHam Detector

Jan 5th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. $url = 'http://www.kham.com.tw';
  4. $http = curl_init();
  5. $options = array(
  6.     CURLOPT_URL            => $url,
  7.     CURLOPT_HEADER         => false,
  8.     CURLOPT_RETURNTRANSFER => true,
  9. );
  10. curl_setopt_array($http, $options);
  11. $result = curl_exec($http);
  12. $httpStatus = curl_getinfo($http, CURLINFO_HTTP_CODE);
  13. curl_close($http);
  14.  
  15. if (intval($httpStatus) === 200) {
  16.     $result = exec('ps aux | grep mplayer | grep -v grep');
  17.  
  18.     if ($result === '') {
  19.         exec('mplayer ~/Downloads/rock.mp3');
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement