Skip to content

Instantly share code, notes, and snippets.

Created July 10, 2014 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/07133266202d790b1261 to your computer and use it in GitHub Desktop.
Save anonymous/07133266202d790b1261 to your computer and use it in GitHub Desktop.
server side:
<?php
if(isset($_GET['h']))
{
$filename="data/".str_replace('.','',$_GET['h']).'.txt';
if(!file_exists($filename))
{
file_put_contents($filename,$_GET['h']);
}
if(isset($_GET['s']))
{
file_put_contents($filename, date('YmdHis').'-'.$_GET['h'].': '.$_GET['s']);
echo 'k.';
}
else
{
file_put_contents($filename, date('YmdHis').'-'.$_GET['h'].': ');
}
}
?>
on rpi:
#!/bin/bash
URL="http://yourdomain/rpi.php"
STRING=`uptime`
wget -O - -q $URL"?h=$HOSTNAME&s=$STRING"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment