summaryrefslogtreecommitdiffstats
path: root/client/engine/FileSystem.lib
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2015-04-20 10:56:54 +0000
committerramon <ramongomez@us.es>2015-04-20 10:56:54 +0000
commit1a2fa9d82bafd3ef8e0d703bf715fe3e58853d0d (patch)
tree1e008f200ff4b413d0807eee03df75ef42f39fab /client/engine/FileSystem.lib
parentc916af9faafcd8fa120aeaf9092c0847aa09183a (diff)
#673: Actualizar código incluido en OepnGnSys 1.0.6 sobre la rama {{{version1.1}}} para desarrollar la nueva versión.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4609 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/FileSystem.lib')
-rwxr-xr-xclient/engine/FileSystem.lib15
1 files changed, 6 insertions, 9 deletions
diff --git a/client/engine/FileSystem.lib b/client/engine/FileSystem.lib
index d3e164d6..257c5a23 100755
--- a/client/engine/FileSystem.lib
+++ b/client/engine/FileSystem.lib
@@ -227,7 +227,7 @@ esac
function ogFormatFs ()
{
# Variables locales
-local PART ID TYPE LABEL PROG PARAMS LABELPARAM ERRCODE
+local PART TYPE LABEL PROG PARAMS LABELPARAM ERRCODE
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
@@ -244,7 +244,7 @@ fi
PART="$(ogDiskToDev $1 $2)" || return $?
# Error si la partición está montada o bloqueada.
if ogIsMounted $1 $2; then
- ogRaiseError $OG_ERR_PARTITION "$1 $2" # Indicar nuevo error
+ ogRaiseError $OG_ERR_DONTFORMAT "$MSG_MOUNT: $1 $2"
return $?
fi
if ogIsLocked $1 $2; then
@@ -384,7 +384,7 @@ echo ${SIZE%.0*}
function ogGetFsType ()
{
# Variables locales.
-local PART ID TYPE
+local PART TYPE
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_nfilesys" \
@@ -396,16 +396,13 @@ fi
# Detectar tipo de sistema de archivo (independientemente del tipo de partición).
PART=$(ogDiskToDev "$1" "$2") || return $?
-TYPE=$(blkid -o export $PART | awk -F= '$1~/^TYPE/ { print toupper($2) }')
+TYPE=$(blkid -o export $PART | awk -F= '$1=="TYPE" { print toupper($2) }')
# Componer valores correctos.
case "$TYPE" in
EXT4) # Comprobar si es caché o Ext4.
- if [ "$1 $2" == "$(ogFindCache)" ]; then
- ogIsFormated $1 $2 2>/dev/null && TYPE="CACHE"
- fi
- ;;
- VFAT) TYPE="$(blkid -po export $PART | awk -F= '$1~/^VERSION$/ { print toupper($2) }')" ;;
+ [ "$1 $2" == "$(ogFindCache)" ] && TYPE="CACHE" ;;
+ VFAT) TYPE="$(blkid -po export $PART | awk -F= '$1=="VERSION" { print toupper($2) }')" ;;
SWAP) TYPE="LINUX-SWAP" ;;
LVM*) TYPE="LINUX-LVM" ;;
*RAID*) TYPE="LINUX-RAID" ;;