__file: implement --state exists

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2012-11-07 16:28:21 +01:00
parent 8f525fbc83
commit f769b395c2
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ exists="$(cat "$__object/explorer/exists")"
[ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do
if [ "$state_should" = "present" ]; then
if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then
if [ -f "$__object/parameter/source" ]; then
source="$(cat "$__object/parameter/source")"
if [ "$source" = "-" ]; then

View file

@ -26,7 +26,7 @@ state_should="$(cat "$__object/parameter/state")"
exists="$(cat "$__object/explorer/exists")"
case "$state_should" in
present)
present|exists)
# No source? Create empty file
if [ ! -f "$__object/parameter/source" ]; then
if [ "$exists" = "no" ]; then