Commit ab6f07f8 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

get eyesis4pi free space

parent 26c65284
...@@ -39,6 +39,25 @@ switch($cmd){ ...@@ -39,6 +39,25 @@ switch($cmd){
die(symlink($mountpoint,$symlink)); die(symlink($mountpoint,$symlink));
break; break;
case "free_space": case "free_space":
//sda1
if (is_dir($mountpoint)) $sda1 = round(disk_free_space($mountpoint)/1024/1024/1024,2);
//sda2
if (!is_file($camogmdisk)){
$devices = get_raw_dev();
foreach($devices as $device=>$size){
//size in MB
if ($device=="/dev/sda2") $sda2 = round($size/1048576,2);
}
}else{
//read camogm.disk file
$sda2 = 10;
}
respond_xml("{$sda1}G {$sda2}G");
break;
case "free_space_bkp":
// results are in GB // results are in GB
// /dev/sda2 is not a mountpoint but a device because it does not have a file system // /dev/sda2 is not a mountpoint but a device because it does not have a file system
$res = 0; $res = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment