checkFreeSpace
|
$max_usage=90; //%
$output=array();
exec('df',$output);
//var_dump($output);
$problems=0;
$problems_details='';
foreach($output as $line) {
if (preg_match('/(\d+)% (\/.+)/',$line,$m))
$proc=$m[1];
$path=$m[2];
if ($proc>$max_usage) {
$problems++;
$problems_details.="$path: $proc; ";
}
//echo "$path: $proc%<br/>";
}
sg("ThisComputer.SpaceProblems",$problems);
sg("ThisComputer.SpaceProblems_Details",$problems_details);
setTimeOut('checkFreeSpace','runScript("checkFreeSpace");',5*60);
|
rebootSystem
|
$filename = ROOT . '/database_backup/db.sql';
$mysqlDumpPath = "/usr/bin/mysqldump";
$mysqlDumpParam = " --user=" . DB_USER . " --password=" . DB_PASSWORD;
$mysqlDumpParam .= " --no-create-db --add-drop-table --databases " . DB_NAME;
if (file_exists($filename)) rename($filename, $filename . '.prev');
exec($mysqlDumpPath . $mysqlDumpParam . " > " . $filename);
say(LANG_GENERAL_STARTING_REBOOT,2);
setTimeout("shutdownTimer","safe_exec('shutdown -r now');",15);
|
shutDown
|
$filename = ROOT . '/database_backup/db.sql';
$mysqlDumpPath = "/usr/bin/mysqldump";
$mysqlDumpParam = " --user=" . DB_USER . " --password=" . DB_PASSWORD;
$mysqlDumpParam .= " --no-create-db --add-drop-table --databases " . DB_NAME;
if (file_exists($filename)) rename($filename, $filename . '.prev');
exec($mysqlDumpPath . $mysqlDumpParam . " > " . $filename);
say(LANG_GENERAL_STARTING_SHUTDOWN,2);
setTimeout("shutdownTimer","safe_exec('shutdown -h now');",15);
|
Megapolis FM 89.5
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио Megapolis FM 89.5',2);
cm('RadioSetting.Control', array('sta:Megapolis FM 89.5'));
cm('RadioSetting.Control',array('play'));
setGlobal("RadioSetting.RadioLedOn",1);
|
RadioOff
|
cm('RadioSetting.Control',array('cmd'=>'stop'));
setGlobal("Radio.RadioLedOn",0);
say('Радио выключено');
|
RadioOn
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио');
cm('RadioSetting.Control',array('cmd'=>'play'));
setGlobal("RadioSetting.RadioLedOn",1);
|
Vol+
|
$vol = gg("ThisComputer.volumeLevel");
setGlobal('ThisComputer.volumeLevel', $vol+10);
if ($vol < 100){
cm('RadioSetting.Control',array('vol'=> $vol+10 ));
} else {
cm('RadioSetting.Control',array('vol'=> 100 ));
}
|
Vol-
|
$vol = gg("ThisComputer.volumeLevel");
setGlobal('ThisComputer.volumeLevel', $vol-10);
if ($vol > 10){
cm('RadioSetting.Control',array('vol'=> $vol-10 ));
} else {
cm('RadioSetting.Control',array('vol'=> 0 ));
}
|
Бизнес FM 87.5
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио Бизнес FM 87.5',2);
cm('RadioSetting.Control', array('sta:Бизнес FM 87.5'));
cm('RadioSetting.Control',array('play'));
setGlobal("RadioSetting.RadioLedOn",1);
|
Детское радио 96.8
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио Детское радио 96.8',2);
cm('RadioSetting.Control', array('sta:Детское радио 96.8'));
cm('RadioSetting.Control',array('play'));
setGlobal("RadioSetting.RadioLedOn",1);
|
Наше радио 101.7
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио Наше радио 101.7',2);
cm('RadioSetting.Control', array('sta:Наше радио 101.7'));
cm('RadioSetting.Control',array('play'));
setGlobal("RadioSetting.RadioLedOn",1);
|
Радио Джаз 89.1
|
cm('RadioSetting.Control', array('stop'));
say('Включаю радио Радио Джаз 89.1',2);
cm('RadioSetting.Control', array('sta:Радио Джаз 89.1'));
cm('RadioSetting.Control',array('play'));
setGlobal("RadioSetting.RadioLedOn",1);
|