From bd28aa99aef6f7ab11a6a2ea980edd30f7e1934f Mon Sep 17 00:00:00 2001
From: Daniel Ehlers <danielehlers@mindeye.net>
Date: Fri, 9 May 2014 13:38:26 +0200
Subject: [PATCH] Return exit code on missing value

Let the site configuration value script return 1 when
the requested value is not available.This enables us
to react on failures, so we can for example use a default
value.

With this patch the script will return with exitcode 1 if
the value is not found and no output on stdout. Otherwise
exitcode is 0 and the value is returned on stdout.
---
 scripts/site.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/site.sh b/scripts/site.sh
index 76215706a..2da61cdf5 100755
--- a/scripts/site.sh
+++ b/scripts/site.sh
@@ -2,4 +2,5 @@
 
 export GLUONDIR="$(dirname "$0")/.."
 
-echo "@$1@" | $GLUONDIR/scripts/configure.pl $GLUONDIR/scripts/generate.pl
+RESULT=$(echo "@$1@" | $GLUONDIR/scripts/configure.pl $GLUONDIR/scripts/generate.pl)
+test ! "$RESULT" = "@$1@" && echo $RESULT
-- 
GitLab