/[soft]/drakpxelinux/branches/1/deployd.sh
ViewVC logotype

Contents of /drakpxelinux/branches/1/deployd.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1654 - (show annotations) (download) (as text)
Thu Jun 2 20:52:01 2011 UTC (12 years, 10 months ago) by dmorgan
File MIME type: application/x-sh
File size: 833 byte(s)
Branch for updates
1 #!/bin/sh
2
3 PXE_ROOT=/var/lib/tftpboot/X86PC/linux/pxelinux.cfg
4 MAC_TABLE=/var/lib/tftpboot/X86PC/conf_mac_profiles
5
6 log() {
7 logger -t deployd $@
8 }
9
10 read MAC_ADDR
11 PXE_ADDR=01-${MAC_ADDR//:/-}
12 PXE_FILE=${PXE_ROOT}/${PXE_ADDR}
13
14 NEW_PROFILE=`awk --field-separator \| "!/^#/ { if (\\$1 == \"$MAC_ADDR\") print \\$3}" /var/lib/tftpboot/X86PC/conf_mac_profiles`
15
16 if [ -n "${NEW_PROFILE}" ]; then
17 INST_LINK=`readlink ${PXE_FILE}`
18 NEW_LINK=profiles/boot/${NEW_PROFILE}
19 if [ ${INST_LINK} = ${NEW_LINK} ]; then
20 log "${MAC_ADDR} was already installed"
21 elif ln -sf ${NEW_LINK} ${PXE_FILE}; then
22 killall -USR1 drakpelinux
23 log "${MAC_ADDR} successfully installed"
24 else
25 log "unable to switch ${MAC_ADDR} to boot profile"
26 fi
27 else
28 log "failed to locate configuration for ${MAC_ADDR}"
29 fi

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30