Guest User

Untitled

a guest
Nov 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2.  
  3. // Your code is so slow that rewriting it in PHP would make it faster!
  4.  
  5.  
  6. // cron this...
  7.  
  8. $namecoind = '/coin/namecoin/namecoind';
  9. if( !namecoind_is_running() ) { debug('ERROR: namecoind is NOT running'); exit; }
  10.  
  11. $up_name = 'announcement/foobar';
  12. $mytime = gmdate('r');
  13.  
  14. $up_array = array();
  15. $up_array['announcement'] = 'Namecoin Network Forecast: '
  16. . ' A high pressure cell is slowly moving towards the network, predicted to hit around block 19100.'
  17. . ' Hurricane-level disruptions to the blockchain and supporting infrastructure are expected.'
  18. . ' Be prepared to update your client software, possibly multiple times.'
  19. . ' Until then, keep calm and carry on.'
  20. ;
  21.  
  22. $up_array['time'] = $mytime;
  23. $up_json = json_encode($up_array);
  24. $up_cmd = "$namecoind name_update '$up_name' '$up_json' 2>&1 ";
  25. $update = shell_exec($up_cmd);
  26.  
  27. exit;
  28.  
  29. /* *********************************************** */
  30. function namecoind_is_running() {
  31.         $x = shell_exec("ps x | grep namecoind | grep -v 'grep'");
  32.         if( $x ) { return TRUE; }
  33.         return FALSE;
  34. }
Add Comment
Please, Sign In to add comment