summaryrefslogtreecommitdiffstats
path: root/deployd.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-09-14 16:08:26 +0000
committerOlivier Blin <oblin@mandriva.org>2005-09-14 16:08:26 +0000
commit84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1 (patch)
tree7c160bd976aa9ad9e9bd3f1442cc4dc02a797840 /deployd.sh
parent35478e4bc0c788902f802e65ee7dfd09d10b58a6 (diff)
downloaddrakpxelinux-84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1.tar
drakpxelinux-84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1.tar.gz
drakpxelinux-84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1.tar.bz2
drakpxelinux-84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1.tar.xz
drakpxelinux-84acc68b5d9d076bb8ff3dce0fd0bf2c25f0b4c1.zip
update PXE links according to mac table configuration
Diffstat (limited to 'deployd.sh')
-rwxr-xr-xdeployd.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/deployd.sh b/deployd.sh
index 692196a..84f7bcc 100755
--- a/deployd.sh
+++ b/deployd.sh
@@ -1,6 +1,7 @@
#!/bin/sh
PXE_ROOT=/var/lib/tftpboot/X86PC/linux/pxelinux.cfg
+MAC_TABLE=/var/lib/tftpboot/X86PC/conf_mac_profiles
log() {
logger -t deployd $@
@@ -10,12 +11,14 @@ read MAC_ADDR
PXE_ADDR=01-${MAC_ADDR//:/-}
PXE_FILE=${PXE_ROOT}/${PXE_ADDR}
-if [ -L ${PXE_FILE} ]; then
+NEW_PROFILE=`awk --field-separator \| "!/^#/ { if (\\$1 == \"$MAC_ADDR\") print \\$3}" /var/lib/tftpboot/X86PC/conf_mac_profiles`
+
+if [ -n "${NEW_PROFILE}" ]; then
INST_LINK=`readlink ${PXE_FILE}`
- BOOT_LINK=${INST_LINK/install/boot}
- if [ ${INST_LINK} = ${BOOT_LINK} ]; then
+ NEW_LINK=profiles/boot/${NEW_PROFILE}
+ if [ ${INST_LINK} = ${NEW_LINK} ]; then
log "${MAC_ADDR} was already installed"
- elif ln -sf ${BOOT_LINK} ${PXE_FILE}; then
+ elif ln -sf ${NEW_LINK} ${PXE_FILE}; then
log "${MAC_ADDR} successfully installed"
else
log "unable to switch ${MAC_ADDR} to boot profile"