From fc501232ab50d7b4e5aa1441d76515f4de1d275f Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 31 Aug 2005 16:46:17 +0000 Subject: initial deployment server implementation --- deployd.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 deployd.sh (limited to 'deployd.sh') diff --git a/deployd.sh b/deployd.sh new file mode 100755 index 0000000..692196a --- /dev/null +++ b/deployd.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +PXE_ROOT=/var/lib/tftpboot/X86PC/linux/pxelinux.cfg + +log() { + logger -t deployd $@ +} + +read MAC_ADDR +PXE_ADDR=01-${MAC_ADDR//:/-} +PXE_FILE=${PXE_ROOT}/${PXE_ADDR} + +if [ -L ${PXE_FILE} ]; then + INST_LINK=`readlink ${PXE_FILE}` + BOOT_LINK=${INST_LINK/install/boot} + if [ ${INST_LINK} = ${BOOT_LINK} ]; then + log "${MAC_ADDR} was already installed" + elif ln -sf ${BOOT_LINK} ${PXE_FILE}; then + log "${MAC_ADDR} successfully installed" + else + log "unable to switch ${MAC_ADDR} to boot profile" + fi +else + log "failed to locate configuration for ${MAC_ADDR}" +fi -- cgit v1.2.1