refs #273 Deletes some copy-paste typos
parent
54e13e45d9
commit
1b3e59cb8e
|
|
@ -98,44 +98,7 @@ local DEPENDENCIES=(
|
||||||
tftpd-hpa
|
tftpd-hpa
|
||||||
xinetd
|
xinetd
|
||||||
build-essential
|
build-essential
|
||||||
g++-multilibgenerate_ipxe_script() {
|
g++-multilib
|
||||||
|
|
||||||
echo "Generando script IPXE..."
|
|
||||||
ip_address_server=$(ifconfig eth0 | awk '/inet / {print $2}')
|
|
||||||
template="etc/dhcp_boot.ipxe.tmpl"
|
|
||||||
|
|
||||||
ipxe_output="/opt/opengnsys/tftpboot/ipxe_scripts/dhcp_boot.ipxe"
|
|
||||||
|
|
||||||
# Reemplazar SERVERIP con la dirección IP en la plantilla y guardarla en el archivo de salida
|
|
||||||
sed "s/SERVERIP/$ip_address_server/g" "$template" > "$ipxe_output"
|
|
||||||
|
|
||||||
template_default="tftpboot/ipxe_scripts/default.ipxe"
|
|
||||||
|
|
||||||
default_output="/opt/opengnsys/tftpboot/ipxe_scripts/default.ipxe"
|
|
||||||
|
|
||||||
mac_script_template="etc/mac_script.ipxe.tmpl"
|
|
||||||
|
|
||||||
sed "s/SERVERIP/$ip_address_server/g" "$template_default" > "$default_output"
|
|
||||||
echo "Creando ficheros MAC script"
|
|
||||||
for client_declaration in "${CLIENTS[@]}"; do
|
|
||||||
# Evaluar la cadena para reconstruir el array asociativo del cliente
|
|
||||||
eval "$client_declaration"
|
|
||||||
|
|
||||||
hostname="${CLIENT[hostname]}"
|
|
||||||
mac_address="${CLIENT[mac_address]}"
|
|
||||||
ip_address="${CLIENT[ip_address]}"
|
|
||||||
mac_address_lower=$(echo "$mac_address" | tr '[:upper:]' '[:lower:]')
|
|
||||||
filename="01-${mac_address_lower}"
|
|
||||||
sed "s/SERVERIP/$ip_address_server/g; s/IP_ADDRESS/$ip_address/g; s/HOSTNAME/$hostname/g; s/MAC_ADDRESS/$mac_address/g" $mac_script_template > "/opt/opengnsys/tftpboot/ipxe_scripts/$filename"
|
|
||||||
echo "Archivo $filename creado con los parámetros modificados."
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
echo "Archivos creados correctamente."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
graphviz
|
graphviz
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue