Commit c1c8810a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

check if mountpoint exists

parent 0cbbb629
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -175,10 +175,14 @@ else if ($cmd=="get_hdd_space"){
		$mountpoint = $_GET['mountpoint'];
	else
		$mountpoint = '/mnt/sda1';
		
        if (is_dir($mountpoint)) $res = disk_free_space($mountpoint);
        else                     $res = 0;
		
	xml_header();
	echo "<command>".$cmd."</command>";
	echo "<".$cmd.">";
	echo disk_free_space($mountpoint);
	echo $res;
	echo "</".$cmd.">";
	xml_footer();