Return values replaced
This commit is contained in:
parent
5333b98299
commit
35df795342
2 changed files with 4 additions and 7 deletions
|
@ -29,13 +29,10 @@ regex=$(cat "$__object/parameter/line")
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
grep -q "^$regex\$" "$file"
|
grep -q "^$regex\$" "$file"
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
# regex pattern not found --> success
|
echo "NOTFOUND"
|
||||||
echo "SUCCESS"
|
|
||||||
else
|
else
|
||||||
# regex pattern found --> failure
|
echo "FOUND"
|
||||||
echo "FAILURE"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# file does not exist --> line not in file
|
echo "NOTFOUND"
|
||||||
echo "SUCCESS"
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -27,7 +27,7 @@ fi
|
||||||
|
|
||||||
result=$(cat "$__object/explorer/findline")
|
result=$(cat "$__object/explorer/findline")
|
||||||
|
|
||||||
if [ $result = "SUCCESS" ]; then
|
if [ "$result" = "NOTFOUND" ]; then
|
||||||
line=$(cat "$__object/parameter/line")
|
line=$(cat "$__object/parameter/line")
|
||||||
echo "echo $line >> $file"
|
echo "echo $line >> $file"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue