[Fai-commit] r3948 - trunk/bin
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Wed Sep 13 15:38:38 UTC 2006
Author: lange
Date: 2006-09-13 15:38:37 +0000 (Wed, 13 Sep 2006)
New Revision: 3948
Modified:
trunk/bin/fai
Log:
print message if FAI_ETC_DIR was used from the environment variable
Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai 2006-09-13 15:12:40 UTC (rev 3947)
+++ trunk/bin/fai 2006-09-13 15:38:37 UTC (rev 3948)
@@ -134,6 +134,8 @@
fstart() {
# these tasks can define variables, that are needed later
+ echo $etc_message
+ unset etc_message
task confdir
task setup
task defclass
@@ -145,10 +147,6 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main routine
-# use FAI_ETC_DIR from environment variable
-[ -z "$FAI_ETC_DIR" ] && FAI_ETC_DIR=/etc/fai
-export FAI_ETC_DIR
-
# Parse commandline options
TEMP=$(getopt -o Nhvc:C: --long new,help,verbose,class:,cfdir: -n "$0" -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
@@ -172,7 +170,7 @@
;;
-C|--cfdir)
shift
- FAI_ETC_DIR=$1
+ cfdir=$1
shift
;;
-c|--class)
@@ -197,6 +195,16 @@
esac
done
+# use FAI_ETC_DIR from environment variable
+if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then
+ # print this message later so it gets into the log files
+ etc_message="Using $FAI_ETC_DIR as FAI_ETC_DIR."
+fi
+[ -n "$cfdir" ] && FAI_ETC_DIR=$cfdir
+unset cfdir
+: ${FAI_ETC_DIR:=/etc/fai}
+export FAI_ETC_DIR
+
# override FAI_ACTION later if a command line argument is given
[ "$1" ] && action=$1
[ "$2" ] && targetdir=$2 # only used for dirinst
@@ -262,7 +270,6 @@
fstart &> $LOGDIR/logfifo
rm $LOGDIR/logfifo
sleep 1 # wait for tee to complete. One second should be ok
-
# old code
# {
# # a bash group command with { does not work on sparc
More information about the Fai-commit
mailing list