summaryrefslogtreecommitdiffstats
path: root/extras/updategrubprofile
blob: f2c83e2d94896bb3e77d1dfd0c2d35efe07f239f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

[ $# -gt 1 ] && exit 1
source "$1" || exit 1

# Obtener directorio ogLive a partir de los datos.
OGLIVEDIR=$(echo "$DATA" | awk -F= 'BEGIN {RS=" "} $1=="oglivedir" {print $2}')

# Elimina "oglivedir" de los parametros si ya esta en la plantilla.
if grep -q "oglivedir=" ${TEMPLATE_PATH} 2>/dev/null; then
        DATA="${DATA/oglivedir=$OGLIVEDIR/}"
fi

sed -e "s,vga=[0-9]*,,g; s,INFOHOST,${DATA//,/\\,},g; s,set ISODIR=.*,set ISODIR=$OGLIVEDIR,g" ${TEMPLATE_PATH} >${PXEFILE_PATH}