29 |
do |
do |
30 |
evaluate_table_xml client_locations "where location='${loc}'" |
evaluate_table_xml client_locations "where location='${loc}'" |
31 |
|
|
32 |
|
# fallback to honor old database versions in transition phase of the upgrade |
33 |
|
if [[ -z ${client_locations_bootserver} ]] || [[ ${client_locations_bootserver} = NULL ]] |
34 |
|
then |
35 |
|
client_locations_bootserver="${client_locations_controlserver}" |
36 |
|
fi |
37 |
|
|
38 |
sed \ |
sed \ |
39 |
-e "s:@@DEFAULTENTRY@@:${client_locations_pxe_default_entry}:g" \ |
-e "s:@@DEFAULTENTRY@@:${client_locations_pxe_default_entry}:g" \ |
40 |
-e "s:@@TIMEOUT@@:${client_locations_pxe_timeout}:g" \ |
-e "s:@@TIMEOUT@@:${client_locations_pxe_timeout}:g" \ |
41 |
-e "s:@@PROMPT@@:${client_locations_pxe_prompt}:g" \ |
-e "s:@@PROMPT@@:${client_locations_pxe_prompt}:g" \ |
42 |
|
-e "s:@@BOOTSERVER@@:${client_locations_bootserver}:g" \ |
43 |
-e "s:@@CONTROLSERVER@@:${client_locations_controlserver}:g" \ |
-e "s:@@CONTROLSERVER@@:${client_locations_controlserver}:g" \ |
44 |
|
-e "s:@@LOCATION@@:${client_locations_location}:g" \ |
45 |
\ |
\ |
46 |
"${TFTP_DIRECTORY}"/lpxelinux-skeleton \ |
"${TFTP_DIRECTORY}"/lpxelinux-skeleton \ |
47 |
> "${TFTP_DIRECTORY}"/lpxelinux-default-"${client_locations_location}" |
> "${TFTP_DIRECTORY}"/lpxelinux-default-"${client_locations_location}" |
61 |
local config |
local config |
62 |
|
|
63 |
# remove all symlinks but keep file based configs |
# remove all symlinks but keep file based configs |
64 |
for i in $(find ${TFTP_DIRECTORY} -name 01-\*) |
find ${TFTP_DIRECTORY} -name 01-\* -type l | xargs --no-run-if-empty rm |
|
do |
|
|
[[ -L ${TFTP_DIRECTORY}/${i} ]] && rm ${TFTP_DIRECTORY}/${i} |
|
|
done |
|
65 |
|
|
66 |
ids=$(mysqldo "select serial from client_serials where enabled='1' and location <> '';") |
ids=$(mysqldo "select serial from client_serials where enabled='1' and location <> '';") |
67 |
for serial in ${ids} |
for serial in ${ids} |
71 |
then |
then |
72 |
config="${TFTP_DIRECTORY}/01-${client_serials_mac//:/-}" |
config="${TFTP_DIRECTORY}/01-${client_serials_mac//:/-}" |
73 |
# do not update if an individual config file exist |
# do not update if an individual config file exist |
74 |
if [[ -e ${config} ]] |
if [[ -f ${config} ]] |
75 |
then |
then |
76 |
echo "A config file named '${config}' already exist" |
echo "A config file named '${config}' already exist" |
77 |
else |
else |