From 4eaace7dd5c427150cf99b07893bff7c1d072f8c Mon Sep 17 00:00:00 2001 From: Jonas Weber Date: Wed, 20 Jun 2018 11:14:25 +0200 Subject: [PATCH] Handle missing file in __line explorer gracefully closes #675 --- cdist/conf/type/__line/explorer/state | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cdist/conf/type/__line/explorer/state b/cdist/conf/type/__line/explorer/state index afdf3502..2ef252c8 100755 --- a/cdist/conf/type/__line/explorer/state +++ b/cdist/conf/type/__line/explorer/state @@ -39,6 +39,11 @@ else file="/$__object_id" fi +if [ ! -f "$file" ]; then + echo "file_missing" + exit 0 +fi + awk -v position="$position" -v needle="$needle" ' function _find(_text, _pattern) { if (needle == "regex") {