From 1e3f0749fc8c68cf8c4ae8fd1b9cc890e0a30859 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 20 Sep 2012 17:39:14 +0200 Subject: [PATCH] setup line content early Signed-off-by: Nico Schottelius --- conf/type/__line/gencode-remote | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/conf/type/__line/gencode-remote b/conf/type/__line/gencode-remote index 75cd92b4..8ac273e2 100755 --- a/conf/type/__line/gencode-remote +++ b/conf/type/__line/gencode-remote @@ -25,6 +25,7 @@ state_should="present" [ -f "$__object/parameter/file" ] && file=$(cat "$__object/parameter/file") [ -f "$__object/parameter/regex" ] && regex=$(cat "$__object/parameter/regex") [ -f "$__object/parameter/state" ] && state_should=$(cat "$__object/parameter/state") +[ -f "$__object/parameter/line" ] && line=$(cat "$__object/parameter/line") state_is="$(cat "$__object/explorer/state")" @@ -32,11 +33,9 @@ state_is="$(cat "$__object/explorer/state")" case "$state_should" in present) - if [ ! -f "$__object/parameter/line" ]; then + if [ ! "$line" ]; then echo "Required parameter \"line\" is missing" >&2 exit 1 - else - line=$(cat "$__object/parameter/line") fi echo "echo \"$line\" >> $file"