<?

// configuration here
$disk = "/dev/sda1";

// Setup output array
$output = array();

// Diskspace
exec("df -h",$output);
$diskspace = "";
foreach($output as $line)
{
        $cols = split(" ",$line);
        $getper = false;
        foreach($cols as $c)
        {
                if(trim($c) != "")
                {
                        //echo "\n\t\t<td>".$c."</td>";
                        if(trim($c) == $disk) $getper = true;
                        $perpos = stripos($c, "%"); // echo "<br />$c - $perpos - $getper";
                        if(trim($perpos) == "2" && $getper) $diskspace = $c;
                }
        }
}

?>
<?=substr($diskspace,0,2);?>
