Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Your code is so slow that rewriting it in PHP would make it faster!
- // cron this...
- $namecoind = '/coin/namecoin/namecoind';
- if( !namecoind_is_running() ) { debug('ERROR: namecoind is NOT running'); exit; }
- $up_name = 'announcement/foobar';
- $mytime = gmdate('r');
- $up_array = array();
- $up_array['announcement'] = 'Namecoin Network Forecast: '
- . ' A high pressure cell is slowly moving towards the network, predicted to hit around block 19100.'
- . ' Hurricane-level disruptions to the blockchain and supporting infrastructure are expected.'
- . ' Be prepared to update your client software, possibly multiple times.'
- . ' Until then, keep calm and carry on.'
- ;
- $up_array['time'] = $mytime;
- $up_json = json_encode($up_array);
- $up_cmd = "$namecoind name_update '$up_name' '$up_json' 2>&1 ";
- $update = shell_exec($up_cmd);
- exit;
- /* *********************************************** */
- function namecoind_is_running() {
- $x = shell_exec("ps x | grep namecoind | grep -v 'grep'");
- if( $x ) { return TRUE; }
- return FALSE;
- }
Add Comment
Please, Sign In to add comment