From 35df79534210b4bb68bd6043a74eecd34c26f758 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 8 Mar 2011 20:21:10 +0100 Subject: [PATCH] Return values replaced --- conf/type/__addifnosuchline/explorer/findline | 9 +++------ conf/type/__addifnosuchline/gencode | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/conf/type/__addifnosuchline/explorer/findline b/conf/type/__addifnosuchline/explorer/findline index 9367be42..c1633626 100755 --- a/conf/type/__addifnosuchline/explorer/findline +++ b/conf/type/__addifnosuchline/explorer/findline @@ -29,13 +29,10 @@ regex=$(cat "$__object/parameter/line") if [ -f "$file" ]; then grep -q "^$regex\$" "$file" if [ $? -eq 1 ]; then - # regex pattern not found --> success - echo "SUCCESS" + echo "NOTFOUND" else - # regex pattern found --> failure - echo "FAILURE" + echo "FOUND" fi else - # file does not exist --> line not in file - echo "SUCCESS" + echo "NOTFOUND" fi diff --git a/conf/type/__addifnosuchline/gencode b/conf/type/__addifnosuchline/gencode index 898d93f9..f97789ae 100755 --- a/conf/type/__addifnosuchline/gencode +++ b/conf/type/__addifnosuchline/gencode @@ -27,7 +27,7 @@ fi result=$(cat "$__object/explorer/findline") -if [ $result = "SUCCESS" ]; then +if [ "$result" = "NOTFOUND" ]; then line=$(cat "$__object/parameter/line") echo "echo $line >> $file" fi