Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/pxeconfig/mcore-pxeconfig.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

mcore-src/trunk/mcore-tools/src/modules/pxeconfig/pxeconfig.in revision 2674 by niro, Fri Dec 11 08:48:44 2015 UTC mcore-src/trunk/mcore-tools/src/modules/pxeconfig/mcore-pxeconfig.in revision 2785 by niro, Wed Feb 17 10:22:09 2016 UTC
# Line 29  create_pxe_config() Line 29  create_pxe_config()
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}"
# Line 53  symlink_pxe_clients() Line 61  symlink_pxe_clients()
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}
# Line 66  symlink_pxe_clients() Line 71  symlink_pxe_clients()
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

Legend:
Removed from v.2674  
changed lines
  Added in v.2785