diff options
author | alonso <alonso@us.es> | 2010-10-23 09:34:04 +0000 |
---|---|---|
committer | alonso <alonso@us.es> | 2010-10-23 09:34:04 +0000 |
commit | 3ec149cb19165453434984c88e8ba03f648e578e (patch) | |
tree | 9d315751684c2c27ed66ad645aeea52ce9027859 /admin/Interface/getConfiguration | |
parent | 550b680d176cbccfecfe35fad440dd570d90ba5b (diff) |
git-svn-id: https://opengnsys.es/svn/trunk@1314 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Interface/getConfiguration')
-rw-r--r-- | admin/Interface/getConfiguration | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/admin/Interface/getConfiguration b/admin/Interface/getConfiguration new file mode 100644 index 00000000..628c9846 --- /dev/null +++ b/admin/Interface/getConfiguration @@ -0,0 +1,45 @@ +#!/bin/bash + +#_______________________________________________________________________________________________________________________________ +# +# Formato de salida: +# par=Número de particion\tcod=Código de partición\tsfi=Sistema de ficheros\tsoi=Sistema instalado\ttam=Tamaño de la partición\n +#_______________________________________________________________________________________________________________________________ + +cfg=$(listPrimaryPartitions 1) +particiones=$(echo $cfg | awk '{n=split($0,sep," ");print n}') +cfg="" +for ((par=1;par<=$particiones;par++)); + do + # Tipo de partición o sistema de fichero + fsi=$(getFsType 1 $par 2>/dev/null) + fsi=${fsi:-"EMPTY"} + # Tamaño de la particón + tam=$(ogGetPartitionSize 1 $par 2>/dev/null) + tam=${tam:-"0"} + # Código de la partición + cod=$(ogFsToId $fsi) + + + if [ $cod == 82 ]; then + soi=" " + else + # Sistema de fichero instalado + soi=$(getOsVersion 1 $par 2>/dev/null) + soi=$(echo $soi | awk '{split($0,sep,":"); print sep[2]}') + fi + + cfg=$(echo $cfg$par":"$cod":"$fsi":"$soi":"$tam";") + +done + +echo $cfg | awk '{ + n=split($0,sep,";"); + for(i=1;i<n;i++){ + split(sep[i],dua,":"); + printf("par=%s\tcpt=%s\tfsi=%s\tsoi=%s\ttam=%s\n",dua[1],dua[2],dua[3],dua[4],dua[5]); + } + + }' + + |