Commit 5e46288d authored by Mikhail Karpenko's avatar Mikhail Karpenko

Show partitions in a list

parent 8a3d9375
......@@ -59,13 +59,14 @@ function table_body($disks)
} else if ($ret_val == 0 && $num == 0) {
exec($parted_script . " --partitions", $output, $ret);
if ($ret == 0) {
$msg = "Disk is already partitioned: ";
$msg = "Disk is already partitioned: <ul>";
foreach ($output as $line) {
$plist = explode(':', $line);
foreach ($plist as $p) {
$msg = $msg . $p . " ";
$msg = $msg . "<li>" . $p . "</li>";
}
}
$msg = $msg . "</ul>";
$partition = substr($plist[0], 0, strpos($plist[0], '(') - 1);
$disk = substr($partition, 0, -1);
table_row(0, $disk, "", "", $msg);
......
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