918-git-images-111dconfigure-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-instalacion
Rev | Line | |
---|
[831830f] | 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 |
---|
[ccbb493] | 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 |
---|
[831830f] | 10 | #*/ ## |
---|
| 11 | |
---|
[ccbb493] | 12 | #REPOIP="$(ogGetRepoIp)" |
---|
| 13 | |
---|
| 14 | # Asignamos la IP del servidor de administracion que es el destino del script |
---|
| 15 | SERVERIP="$(ogGetServerIp)" |
---|
[831830f] | 16 | PORT=2011 |
---|
[ccbb493] | 17 | TEMPLATE=$(grep -l "^#.* $1 *$" /opt/oglive/tftpboot/menu.lst/templates/*) |
---|
[831830f] | 18 | PCNAME="$(hostname)" |
---|
| 19 | |
---|
[32ffd2f] | 20 | PROG="$(basename $0)" |
---|
[831830f] | 21 | if [ "$*" == "help" ]; then |
---|
[3a47e17] | 22 | ogHelp "$PROG" "$PROG template [ 0 | 1 ] (0 - Temporary 1, - Permanent) " \ |
---|
[341cb58] | 23 | "$PROG ogLive 1" \ |
---|
[3a47e17] | 24 | "$PROG 1hd-1partition 0" |
---|
[831830f] | 25 | exit |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | # Control básico de errores. |
---|
[ccbb493] | 30 | if [ $# -ne 2 ]; then |
---|
[3a47e17] | 31 | ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT: $PROG TEMPLATE_NAME [ 0 | 1 ] (0 - Temporary, 1 - Permanent)" |
---|
[831830f] | 32 | exit $? |
---|
| 33 | fi |
---|
[ccbb493] | 34 | |
---|
| 35 | if [ -z "$TEMPLATE" ]; then |
---|
[d216749] | 36 | ogRaiseError $OG_ERR_NOTFOUND "$MSG_ERR_NOTFOUND: $1" |
---|
[831830f] | 37 | exit $? |
---|
| 38 | fi |
---|
| 39 | |
---|
[ccbb493] | 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" |
---|
[831830f] | 46 | |
---|
| 47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.