[Fai-commit] r3714 - trunk/bin
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Mon Jul 31 21:52:41 UTC 2006
Author: lange
Date: 2006-07-31 21:52:40 +0000 (Mon, 31 Jul 2006)
New Revision: 3714
Modified:
trunk/bin/fai
Log:
core cleanup
Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai 2006-07-31 21:52:25 UTC (rev 3713)
+++ trunk/bin/fai 2006-07-31 21:52:40 UTC (rev 3714)
@@ -37,14 +37,11 @@
# the type of operating system (linux, sunos)
oclass=$(uname -s | tr a-z A-Z)
-# $classes is now set so we can call hooks before fai-class defines the classes
-classes="DEFAULT $oclass $HOSTNAME LAST"
unset oclass
faimond=0
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fai_init() {
- local sub ostype
set -a # now export all variables
umask 022
@@ -65,11 +62,10 @@
# some variables from are not needed any more
unset FAI_CONFIGDIR
- ostype=$(uname -s | tr A-Z a-z)
# read subroutine definitions
- sub=/usr/lib/fai/subroutines
+ local sub=/usr/lib/fai/subroutines
[ -f $sub ] && . $sub
- [ -f $sub-$ostype ] && . $sub-$ostype
+ [ -f $sub-linux ] && . $sub-linux
[ -f "$stamp" ] && {
echo "$0 already running, aborting"
@@ -105,6 +101,8 @@
hostname $HOST
echo "Hostname set to $HOST" | tee -a $LOGDIR/fai.log
fi
+ # since HOSTNAME may change define classes now, so we can call hooks before fai-class is called
+ [ -z "$classes" ] && classes="DEFAULT $oclass $HOSTNAME LAST"
if [ $DO_INIT_TASKS -eq 1 ]; then
mount -t sysfs sysfs /sys
More information about the Fai-commit
mailing list