From 3aa15d98a9e44a9a99217c4957fa0044daf543a9 Mon Sep 17 00:00:00 2001 From: Nicolas LLOBERA Date: Mon, 20 Mar 2017 23:19:19 +0100 Subject: [PATCH] manages spaces in mount point names --- libs/disk.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/disk.php b/libs/disk.php index 0cf9587..ebab6bc 100644 --- a/libs/disk.php +++ b/libs/disk.php @@ -4,7 +4,9 @@ $Config = new Config(); $datas = array(); -if (!(exec('/bin/df -T -P | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $2}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6","$7}\'', $df))) +# if there are more than 7 awk's colums it means the mount point name contains spaces +# so consider the first colums as a unique colum and the last 6 as real colums +if (!(exec('/bin/df -T -P | tail -n +2 | awk \'{ if (NF > 7) { for (i=1; i 'N.A',