[Fai-commit] r6772 - trunk/bin

Michael Prokop mika at alioth.debian.org
Mon Oct 24 12:36:40 UTC 2011


Author: mika
Date: 2011-10-24 12:36:39 +0000 (Mon, 24 Oct 2011)
New Revision: 6772

Modified:
   trunk/bin/make-fai-nfsroot
Log:
make-fai-nfsroot: provide proper return code in fdivert()

The 'return' command uses the exit status of the last executed
command if no status is given. Since we're running under 'set -e'
this causes fdivert() to error out the main make-fai-nfsroot
script whenever $NFSROOT_HOOKS doesn't exist. So instead return
with proper status code.

From: Michael Prokop <mika at grml.org>

Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2011-10-24 12:36:33 UTC (rev 6771)
+++ trunk/bin/make-fai-nfsroot	2011-10-24 12:36:39 UTC (rev 6772)
@@ -482,8 +482,8 @@
 run_hooks() {
 
     local file
-    [ -z "$NFSROOT_HOOKS" ] && return
-    [ -d "$NFSROOT_HOOKS" ] || return
+    [ -z "$NFSROOT_HOOKS" ] && return 0
+    [ -d "$NFSROOT_HOOKS" ] || return 0
 
     echo "Running hooks..."
     for file in $(cd $NFSROOT_HOOKS ;ls 2>/dev/null | egrep '^[[:alnum:]_.-]+$'); do




More information about the Fai-commit mailing list