[Fai-commit] r3399 - trunk/bin

fai-repository at svn.debian.org fai-repository at svn.debian.org
Tue Apr 11 22:03:51 UTC 2006


Author: lange
Date: 2006-04-11 22:03:50 +0000 (Tue, 11 Apr 2006)
New Revision: 3399

Modified:
   trunk/bin/fai-mirror
Log:
add option -C, (closes: #318299)


Modified: trunk/bin/fai-mirror
===================================================================
--- trunk/bin/fai-mirror	2006-04-11 21:36:43 UTC (rev 3398)
+++ trunk/bin/fai-mirror	2006-04-11 22:03:50 UTC (rev 3399)
@@ -25,15 +25,14 @@
 # MA 02111-1307, USA.
 #*********************************************************************
 
-version="Version 1.5, 11-april-2006"
+version="Version 1.6, 11-april-2006"
 
 # variables: NFSROOT, FAI_CONFIGDIR
 # NFSROOT_PACKAGES, packages from make-fai-nfsroot.conf
 
-debdist=sarge
-set -a 
-. /etc/fai/fai.conf
-. /etc/fai/make-fai-nfsroot.conf
+debdist=sarge # maybe use this $(echo "$FAI_DEBOOTSTRAP" | awk '{print $1}')
+set -a
+
 FAI_ROOT=/ # do not execute in chroot
 set +a
 
@@ -228,9 +227,10 @@
 verbose=0
 add=0
 qflag=-qq
-while getopts "avhx:pc:" opt ; do
+while getopts "avhx:pc:C:" opt ; do
     case "$opt" in
 	a) add=1 ;;
+	C) cfdir=$OPTARG ;;
 	h) usage ;;
 	x) exclasses="$OPTARG";;
 	c) cclasses="$OPTARG";;
@@ -241,6 +241,15 @@
 done
 shift $(($OPTIND - 1))
 
+[ -z "$cfdir" ] && cfdir=/etc/fai
+if [ ! -d "$cfdir" ]; then
+    echo "$cfdir is not a directory"
+    exit 6
+fi
+[ "$verbose" ] && echo "Using configuration files from directory $cfdir"
+. $cfdir/fai.conf
+. $cfdir/make-fai-nfsroot.conf
+
 [ -n "$exclasses" -a -n "$cclasses" ] && die 3 "Options -x and -c not allowed at the same time."
 debug=0
 [ $debug -eq 0 ] && quiet=-q




More information about the Fai-commit mailing list