Commit c1c8810a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

check if mountpoint exists

parent 0cbbb629
...@@ -175,10 +175,14 @@ else if ($cmd=="get_hdd_space"){ ...@@ -175,10 +175,14 @@ else if ($cmd=="get_hdd_space"){
$mountpoint = $_GET['mountpoint']; $mountpoint = $_GET['mountpoint'];
else else
$mountpoint = '/mnt/sda1'; $mountpoint = '/mnt/sda1';
if (is_dir($mountpoint)) $res = disk_free_space($mountpoint);
else $res = 0;
xml_header(); xml_header();
echo "<command>".$cmd."</command>"; echo "<command>".$cmd."</command>";
echo "<".$cmd.">"; echo "<".$cmd.">";
echo disk_free_space($mountpoint); echo $res;
echo "</".$cmd.">"; echo "</".$cmd.">";
xml_footer(); xml_footer();
......
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