forked from sfedotoff/miwifiradio
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcontrol.php
More file actions
32 lines (32 loc) · 761 Bytes
/
control.php
File metadata and controls
32 lines (32 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
define("_KATE_MAIN", true);
include_once("config/config.php");
//include_once($global_path."include/admin/check_logged.php");
include_once($global_path."include/function.php");
include_once($global_path."include/ffcontrol.php");
Error_Reporting(1);
//echo "Huy!";
if(!isset($_GET['xid']) or !isset($_GET['act'])) {
echo "Error: no param";
exit(0);
}
$xid=$_GET['xid'];
$act=$_GET['act'];
if($act=='stop'){
ffstop($xid);
} elseif ($act=='start') {
$pid=ffstart($xid);
if($pid=='') {
echo "Error: ffmpeg not runing";
} else {
echo "ffmpeg runing with PID: $pid";
}
} elseif ($act=='restart') {
ffstop($xid);
sleep(2);
ffstart($xid);
echo "ffmpeg restarted";
} else {
echo "Error: No such action!";
}
//echo "$id $act";