[Fai-commit] r4817 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Sat Dec 8 14:11:08 UTC 2007


Author: lange
Date: 2007-12-08 14:11:08 +0000 (Sat, 08 Dec 2007)
New Revision: 4817

Modified:
   trunk/bin/fai-cd
Log:
add prefix $cfdir to -g parameter if no path was specified,
otherwise use full path and file name that was given


Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd	2007-12-08 14:09:06 UTC (rev 4816)
+++ trunk/bin/fai-cd	2007-12-08 14:11:08 UTC (rev 4817)
@@ -267,11 +267,11 @@
 
 [ -d "$NFSROOT/etc/fai" ] || die 10 "Please create NFSROOT by calling make-fai-nfsroot or fai-setup."
 
-if [ -z "$grub_config" ]; then
-    grub_config="$cfdir/menu.lst"
-else
-    grub_config="$cfdir/$grub_config"
-fi
+# if -g is a file name, add prefix
+
+[ -z "$grub_config" ] && grub_config="$cfdir/menu.lst" # set default if undefined
+# if grub_config contains / do not change it, else add prefix $cfdir
+echo $grub_config | grep -q '/' || grub_config="$cfdir/$grub_config"
 [ -f "$grub_config" ] || die 13 "Grub menu file $grub_config not found."
 
 [ -z "$FAI_CONFIGDIR" ]  && die 14 "Variable \$FAI_CONFIG not set."




More information about the Fai-commit mailing list