WG updates using Nchan

This commit is contained in:
bergware
2021-05-12 13:53:34 +02:00
parent bc83892fa0
commit bac845a440
+3 -14
View File
@@ -12,20 +12,9 @@
*/
?>
<?
function curl_socket($socket, $url, $postdata = NULL) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, $socket);
if ($postdata !== NULL) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
function publish($endpoint, $message) {
curl_socket("/var/run/nginx.socket", "http://localhost/pub/$endpoint?buffer_length=1", $message);
}
$docroot = '/usr/local/emhttp';
require_once "$docroot/webGui/include/publish.php";
function my_scale($value, &$unit) {
$units = [' ','Ki','Mi','Gi','Ti','Pi','Ei','Zi','Yi'];
$size = count($units);