summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadmin/Interface/CambiarAcceso12
-rwxr-xr-xclient/engine/Net.lib29
-rwxr-xr-xinstaller/opengnsys_installer.sh2
3 files changed, 19 insertions, 24 deletions
diff --git a/admin/Interface/CambiarAcceso b/admin/Interface/CambiarAcceso
index ced882ca..b8d5645b 100755
--- a/admin/Interface/CambiarAcceso
+++ b/admin/Interface/CambiarAcceso
@@ -26,10 +26,10 @@ if ogIsRepoLocked; then
fi
# Comprobar protocolo y modo de acceso.
-protocol=${protocol:-"smb"}
-case "$protocol" in
+PROTO=${ogprotocol:-"smb"}
+case "$PROTO" in
nfs|smb) ;;
- *) ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $protocol"
+ *) ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $PROTO"
exit $? ;;
esac
case "$1" in
@@ -42,8 +42,8 @@ esac
# Desmontar repositorio y volver a montarlo con el modo adecuado.
umount $OGIMG
ogEcho info "$PROG: Montar repositorio $REPO por $protocol en modo $1"
-case "$protocol" in
- nfs) mount -t nfs -o $MODE $REPOIP:$OGIMG $OGIMG ;;
- smb) mount -t cifs //${ROOTSERVER}/ogimages $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=og ;;
+case "$PROTO" in
+ nfs) mount -t nfs $REPOIP:$OGIMG $OGIMG -o $MODE ;;
+ smb) mount -t cifs //$REPOIP/ogimages $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=og ;;
esac
diff --git a/client/engine/Net.lib b/client/engine/Net.lib
index f1f1422c..6ac5a94a 100755
--- a/client/engine/Net.lib
+++ b/client/engine/Net.lib
@@ -112,14 +112,12 @@ echo ${MAC%% *}
function ogGetRepoIp ()
{
# Obtener direcciones IP, segun el protocolo de montaje
-case $ogprotocol in
- nfs)
- [ -n "$OGIMG" ] && mount | grep " $OGIMG .* nfs " | cut -f1 -d:
- ;;
- smb)
- [ -n "$OGIMG" ] && mount | grep ogimages | awk -F"addr=" '{print $2}' | cut -f1 -d","
- ;;
-esac
+if [ -n "$OGIMG" ]; then
+ case "$ogprotocol" in
+ nfs) mount | grep " on $OGIMG " | cut -f1 -d: ;;
+ smb) mount | grep " on $OGIMG " | cut -f3 -d/ ;;
+ esac
+fi
}
@@ -138,14 +136,11 @@ esac
function ogGetServerIp ()
{
# Obtener direcciones IP.
-case $ogprotocol in
- nfs)
- [ -n "$OPENGNSYS" ] && mount | grep " $OPENGNSYS .* nfs " | cut -f1 -d:
- ;;
- smb)
- [ -n "$OGIMG" ] && mount | grep ogclient | awk -F"addr=" '{print $2}' | cut -f1 -d","
- ;;
-esac
+if [ -n "$PENGNSYS" ]; then
+ case "$ogprotocol" in
+ nfs) mount | grep " on $OPENGNSYS " | cut -f1 -d: ;;
+ smb) mount | grep " on $OPENGNSYS " | cut -f3 -d/ ;;
+ esac
+fi
}
-
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index a7cfbfb4..552bc0f6 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -971,7 +971,7 @@ function copyInterfaceAdm ()
echoAndLog "${FUNCNAME}(): error while copying Administration Interface Folder"
hayErrores=1
fi
- chown root:root $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
+ chown $OPENGNSYS_CLIENT_USER $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
return $hayErrores