From 228eb600bf33d60361955290a7fded938c2d8ff9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 9 Jan 2012 15:40:05 +0100 Subject: [PATCH] simplify default value code a lot Signed-off-by: Nico Schottelius --- conf/type/__file/manifest | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/type/__file/manifest b/conf/type/__file/manifest index 915a2ca9..6b5e1ca7 100755 --- a/conf/type/__file/manifest +++ b/conf/type/__file/manifest @@ -1,6 +1,7 @@ #!/bin/sh # # 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2012 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -18,8 +19,6 @@ # along with cdist. If not, see . # -name="$__object_id" - -# set defaults -state="$(cat "$__object/parameter/state" 2>/dev/null \ - || echo "present" | tee "$__object/parameter/state")" +# set default: present, if not setup +statefile="$__object/parameter/state" +[ -f "$statefile" ] || echo present > "$statefile"