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 | # setBootMode |
|---|
| 4 | #@brief Script to configure the PXE mode to client |
|---|
| 5 | #@param 1 template |
|---|
| 6 | #@date 2012-02-2-9 |
|---|
| 7 | #@version 1.0.1 - Recoge como parametro el nombre interno de la plantilla en vez del nombre de fichero para que funcione correctamente al llamar a setclientmode y anade un nuevo parametro de modo de trabajo (0 o 1) que indica que el cambio del fichero PXE del servidor sera temporal o permanente |
|---|
| 8 | #@author Juan Carlos Garcia - Univ. Zaragoza |
|---|
| 9 | #@date 2015-11-17 |
|---|
| 10 | #*/ ## |
|---|
| 11 | |
|---|
| 12 | #REPOIP="$(ogGetRepoIp)" |
|---|
| 13 | |
|---|
| 14 | # Asignamos la IP del servidor de administracion que es el destino del script |
|---|
| 15 | SERVERIP="$(ogGetServerIp)" |
|---|
| 16 | PORT=2011 |
|---|
| 17 | TEMPLATE=$(grep -l "^#.* $1 *$" /opt/oglive/tftpboot/menu.lst/templates/*) |
|---|
| 18 | PCNAME="$(hostname)" |
|---|
| 19 | |
|---|
| 20 | PROG="$(basename $0)" |
|---|
| 21 | if [ "$*" == "help" ]; then |
|---|
| 22 | ogHelp "$PROG" "$PROG template [ 0 | 1 ] (0 - Temporary 1, - Permanent) " \ |
|---|
| 23 | "$PROG ogLive 1" \ |
|---|
| 24 | "$PROG 1hd-1partition 0" |
|---|
| 25 | exit |
|---|
| 26 | fi |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | # Control básico de errores. |
|---|
| 30 | if [ $# -ne 2 ]; then |
|---|
| 31 | ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT: $PROG TEMPLATE_NAME [ 0 | 1 ] (0 - Temporary, 1 - Permanent)" |
|---|
| 32 | exit $? |
|---|
| 33 | fi |
|---|
| 34 | |
|---|
| 35 | if [ -z "$TEMPLATE" ]; then |
|---|
| 36 | ogRaiseError $OG_ERR_NOTFOUND "$MSG_ERR_NOTFOUND: $TEMPLATE" |
|---|
| 37 | exit $? |
|---|
| 38 | fi |
|---|
| 39 | |
|---|
| 40 | if [ $2 != "0" ] && [ $2 != "1" ]; then |
|---|
| 41 | ogRaiseError $OG_ERR_NOTFOUND "$MSG_ERR_FORMAT: modo $2 no existe" |
|---|
| 42 | exit $? |
|---|
| 43 | fi |
|---|
| 44 | # Crea un pipe con el servidor de administracion que llama a setclientmode pasandole los parametros de nombre de plantilla, nombre PC y modo de trabajo (0 o 1) |
|---|
| 45 | hose $SERVERIP $PORT --out sh -c "echo -ne SET_CLIENTMODE $1 $PCNAME $2" |
|---|
| 46 | |
|---|
| 47 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.