forked from ungleich-public/cdist
simplify default value setting
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
7cc9b217da
commit
a55dd390b1
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
|
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||||
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
#
|
#
|
||||||
# This file is part of cdist.
|
# This file is part of cdist.
|
||||||
#
|
#
|
||||||
|
@ -18,6 +19,6 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
# set defaults
|
# set default: present, if not setup
|
||||||
state="$(cat "$__object/parameter/state" 2>/dev/null \
|
statefile="$__object/parameter/state"
|
||||||
|| echo "present" | tee "$__object/parameter/state")"
|
[ -f "$statefile" ] || echo present > "$statefile"
|
||||||
|
|
Loading…
Reference in a new issue