blob: 4ab9c81660801ef6a2428ea9113d3292617f4586 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/bash
# #/**
# setBootMode
#@brief Script to configure the PXE mode to client
#@param 1 template
#@date 2012-02-2-9
#*/ ##
REPOIP="$(ogGetRepoIp)"
PORT=2011
TEMPLATE="/opt/oglive/tftpboot/menu.lst/templates/$1"
PCNAME="$(hostname)"
PROG="$(basename $0)"
if [ "$*" == "help" ]; then
ogHelp "$PROG" "$PROG template" \
"$PROG pxe" \
"$PROG 01"
exit
fi
# Control básico de errores.
if [ $# -ne 1 ]; then
ogRaiseError $OG_ERR_FORMAT "$MSG_ERR_FORMAT: $PROG TEMPLATE_NAME"
exit $?
fi
if [ ! -e $TEMPLATE ]; then
ogRaiseError $OG_ERR_NOTFOUND "$MSG_ERR_NOTFOUND: $TEMPLATE"
exit $?
fi
hose $REPOIP $PORT --out sh -c "echo -ne SET_CLIENTMODE $1 $PCNAME"
|