close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
| Line | |
|---|
| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | #______________________________________ |
|---|
| 4 | # |
|---|
| 5 | # PARAMETROS RECIBIDOS DESDE EL CLIENTE |
|---|
| 6 | # $1 modo (admin, user) |
|---|
| 7 | #______________________________________ |
|---|
| 8 | |
|---|
| 9 | # Error si llamada no se realliza desde OpenGnSys Client. |
|---|
| 10 | PROG=$(basename $0) |
|---|
| 11 | CALLER=$(ogGetCaller) |
|---|
| 12 | if [ "$CALLER" != "CrearImagen" -a "$CALLER" != "ConsolaRemota" ]; then |
|---|
| 13 | ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG" |
|---|
| 14 | exit $? |
|---|
| 15 | fi |
|---|
| 16 | |
|---|
| 17 | # Salir si el repositorio está bloquedo (tiene ficheros abiertos). |
|---|
| 18 | REPOIP=$(ogGetRepoIp) |
|---|
| 19 | if [ -z "$REPOIP" ]; then |
|---|
| 20 | ogRaiseError $OG_ERR_NOTFOUND "repo no montado" |
|---|
| 21 | exit $? |
|---|
| 22 | fi |
|---|
| 23 | if ogIsRepoLocked; then |
|---|
| 24 | ogRaiseError $OG_ERR_LOCKED "repo $REPOIP" |
|---|
| 25 | exit $? |
|---|
| 26 | fi |
|---|
| 27 | |
|---|
| 28 | # Comprobar protocolo y modo de acceso. |
|---|
| 29 | PROTO=${ogprotocol:-"smb"} |
|---|
| 30 | case "$PROTO" in |
|---|
| 31 | nfs|smb) ;; |
|---|
| 32 | *) ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $PROTO" |
|---|
| 33 | exit $? ;; |
|---|
| 34 | esac |
|---|
| 35 | case "$1" in |
|---|
| 36 | admin) MODE="rw,nolock" ;; |
|---|
| 37 | user) MODE="ro,nolock" ;; |
|---|
| 38 | *) ogRaiseError $OG_ERR_FORMAT "modo desconocido $1" |
|---|
| 39 | exit $? ;; |
|---|
| 40 | esac |
|---|
| 41 | |
|---|
| 42 | # Desmontar repositorio y volver a montarlo con el modo adecuado. |
|---|
| 43 | umount $OGIMG |
|---|
| 44 | ogEcho info "$PROG: Montar repositorio $REPO por $PROTO en modo $1" |
|---|
| 45 | case "$PROTO" in |
|---|
| 46 | nfs) mount -t nfs $REPOIP:$OGIMG $OGIMG -o $MODE ;; |
|---|
| 47 | smb) PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \ |
|---|
| 48 | sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/') |
|---|
| 49 | PASS=${PASS:-"og"} |
|---|
| 50 | mount.cifs //$REPOIP/ogimages $OGIMG -o rw,serverino,acl,username=opengnsys,password=$PASS |
|---|
| 51 | esac |
|---|
| 52 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.