summaryrefslogtreecommitdiff
path: root/streamstatus.php
diff options
context:
space:
mode:
Diffstat (limited to 'streamstatus.php')
-rwxr-xr-xstreamstatus.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/streamstatus.php b/streamstatus.php
new file mode 100755
index 0000000..4582dc6
--- /dev/null
+++ b/streamstatus.php
@@ -0,0 +1,21 @@
+<?php
+ header('Content-Type: text/xml');
+ echo "<?xml version=\"1.0\"?>\n";
+ echo "<status>\n";
+ $cnt = 0;
+
+ while ( ( count(glob('ram/*.ts')) < 2 ) && ( $cnt < 25 ) )
+ {
+ // wait for stream available
+ sleep(1);
+ $cnt++;
+ }
+
+ if ( count(glob('ram/*.ts')) < 2 )
+ echo "<streamstatus>error</streamstatus>\n";
+ else
+ echo "<streamstatus>ok</streamstatus>\n";
+
+ echo "</status>\n";
+
+?>