From 6969e456c68c13f84285bd42028f6e0d94939cff Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 12 Aug 2021 11:32:19 +0200 Subject: [PATCH] IPFSNODEID --- www/boris/ajax.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/www/boris/ajax.php b/www/boris/ajax.php index df0a562..0100d8b 100644 --- a/www/boris/ajax.php +++ b/www/boris/ajax.php @@ -9,15 +9,26 @@ if (isset($_REQUEST['phone'])) $phone = $_REQUEST['phone']; else $phone = urldec $message = "Proposition de ". $phone ." message : ".$link; +$TIMESTAMP=system("$(date -u +%s%N | cut -b1-13)", $retval); +print_r($TIMESTAMP); + $YOU=system("ps u -C ipfs | tail -n 1 | cut -f 1 -d ' '", $retval); -// print_r($YOU); -$IPFSNODEID=system("ipfs --timeout=5s id -f='\n'", $retval); +print_r($YOU); + +$IPFSNODEID=system("cat"/home/".$YOU."/.zen/ipfs/.*/.ipfsnodeid", $retval); +print_r($IPFSNODEID); +// WRITE MESSAGE LOCALY $myfile = fopen("/home/".$YOU."/astroport/www/newfile.txt", "w") or die("Unable to open file!"); fwrite($myfile, $message); fclose($myfile); +// WRITE MESSAGE TO IPFS +$myfile = fopen("/home/".$YOU."/.zen/ipfs/.$IPFSNODEID/astroport/www/newfile.txt", "w") or die("Unable to open file!"); +fwrite($myfile, $message); +fclose($myfile); + error_log("SEND ". $phone ." message : ".$link ); mail($to, $subject, $message, $headers); echo "OK";