X-Git-Url: https://jasonwoof.com/gitweb/?p=cmus-lan-control.git;a=blobdiff_plain;f=do.php;fp=do.php;h=6b79e6c31dd646f13ed978894c4fb5f50d4ebab4;hp=0000000000000000000000000000000000000000;hb=45e062540710ac46cb6c2e2e37ef04c534d1cbe9;hpb=e00062e26549a95618297a25f2d9d5f76f172fe6 diff --git a/do.php b/do.php new file mode 100644 index 0000000..6b79e6c --- /dev/null +++ b/do.php @@ -0,0 +1,36 @@ +. + +function do_main() { + header("Content-Type: text/plain"); + $SOCKET="fifo"; + #passthru("mkfifo $SOCKET"); + $fd = fopen($SOCKET, 'a'); + if($fd) { + $command = $_REQUEST['action'] . "\n"; + if(isset($_REQUEST['file'])) { + $command .= $_REQUEST['file'] . "\n"; + } + fwrite($fd, $command); + fclose($fd); + echo "OK"; + exit(); + } + echo "Failed to connect."; +} + +do_main();