-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaymac.php
More file actions
executable file
·30 lines (27 loc) · 878 Bytes
/
playmac.php
File metadata and controls
executable file
·30 lines (27 loc) · 878 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
<?php include_once("/var/www/html/site/secur.php"); ?>
<?
$mac = $_GET['mac'];
$type = $_GET['type'];
if($type == "play"){
//shell_exec("echo -e 'power on\nagent on\nconnect ".$mac." \nquit' | sudo bluetoothctl");
shell_exec('$(sudo bluealsa-aplay --profile-a2dp '.$mac.')');
echo 'ok';
}
elseif($type == "pair"){
shell_exec("echo -e \"power on\nagent on\npair ".$mac." \nyes\nquit\" | sudo bluetoothctl");
echo 'ok';
}
elseif($type == "scanefir"){
echo shell_exec("sudo hcitool scan");
}
elseif($type == "moduleoff"){
//echo shell_exec("sudo /etc/init.d/bluetooth stop");
shell_exec("echo \"power off\nagent off\nquit\" | sudo bluetoothctl");
echo 'ok';
}
elseif($type == "moduleon"){
//echo shell_exec("sudo /etc/init.d/bluetooth start");
shell_exec("echo -e \"power on\nagent on\ndefault-agent\nquit\" | sudo bluetoothctl");
echo 'ok';
}
?>