summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2016-04-28 09:25:40 +0000
committerramon <ramongomez@us.es>2016-04-28 09:25:40 +0000
commit12d6d5b0e2fbd7e35f7a34a41cec9b02a54508e0 (patch)
tree82e96d28712f8d7ad1d218c130d84ca926538699 /client
parentbaea6c327015d859d385caa0239d3aef1371ce2e (diff)
#724: Sustituir {{{sfdisk}}} por {{{partx}}} en funciĆ³n {{{ogGetPartitionsNumber}}} debido al cambio en la salida del 1er comando a partir de Ubuntu 15.10.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4912 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client')
-rwxr-xr-xclient/engine/Disk.lib6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib
index 56031e83..ef775632 100755
--- a/client/engine/Disk.lib
+++ b/client/engine/Disk.lib
@@ -804,9 +804,9 @@ partx -gbo SIZE $PART 2>/dev/null | awk '{print $1/1024}'
#@version 1.0.6 - Soportar LVM.
#@author Universidad de Huelva
#@date 2014-09-04
-#@version 1.1.0 - Soportar ZFS.
+#@version 1.1.0 - Soportar ZFS y sustituir "sfdisk" por "partx".
#@author Ramon Gomez, ETSII Universidad Sevilla
-#@date 2014-11-14
+#@date 2016-04-28
#*/ ##
function ogGetPartitionsNumber ()
{
@@ -825,7 +825,7 @@ fi
DISK=$(ogDiskToDev $1) 2>/dev/null
case "$(ogGetPartitionTableType $1)" in
GPT) grep -c "${DISK#/dev/}." /proc/partitions ;;
- MSDOS) sfdisk -l $DISK 2>/dev/null | grep -c "^$DISK" ;;
+ MSDOS) partx -gso NR $DISK 2>/dev/null | awk -v p=0 '{p=$1} END {print p}' ;;
LVM) lvs --noheadings $DISK 2>/dev/null | wc -l ;;
ZPOOL) zpool list &>/dev/null || modprobe zfs
zpool import -f -R /mnt -N -a 2>/dev/null