diff -r 83502d2099eb -r 0d86f3c0a07b www-thermferm/utilities.php --- a/www-thermferm/utilities.php Wed Jul 30 19:39:50 2014 +0200 +++ b/www-thermferm/utilities.php Wed Jul 30 22:57:48 2014 +0200 @@ -94,3 +94,24 @@ '; } + +/* + * Send command + */ +function send_cmd($cmd) { + $sock = open_socket(); + if ($sock != false) { + /* + * Send command and absorb the result. + */ + socket_write($sock, $cmd, 4096); + while (1) { + $line = socket_read($sock, 4096); + if ($line === '') + break; + } + socket_close($sock); + } +} + +