refs #273 changes array clients declaration to associative array
parent
c478f10d57
commit
4043928bed
|
@ -70,10 +70,9 @@ generate_ipxe_script() {
|
|||
sed "s/SERVERIP/$ip_address/g" "$template_default" > "$default_output"
|
||||
echo "Creando ficheros MAC script"
|
||||
for client in "${CLIENTS[@]}"; do
|
||||
IFS=':' read -r -a campos <<< "$client"
|
||||
hostname="${campos[0]}"
|
||||
mac_address="${campos[1]}"
|
||||
ip_address="${campos[2]}"
|
||||
hostname="${client[hostname]}"
|
||||
mac_address="${client[mac_address]}"
|
||||
ip_address="${client[ip_address]}"
|
||||
filename="01-${mac_address//:/-}"
|
||||
sed "s/IP_ADDRESS/$ip_address/g; s/HOSTNAME/$hostname/g; s/MAC_ADDRESS/$mac_address/g" /opt/opengnsys/tftpboot/ipxe_scripts/default.ipxe > /opt/opengnsys/tftpboot/ipxe_scripts/$filename
|
||||
|
||||
|
|
Loading…
Reference in New Issue