allow failing cat on optional parameter

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-10-02 18:09:52 +02:00
parent 748fc8a258
commit 8c0228bbaa
2 changed files with 3 additions and 2 deletions

View file

@ -23,7 +23,7 @@ ruby="$(echo "$gemset" | cut -d '@' -f 1)"
gemsetname="$(echo "$gemset" | cut -d '@' -f 2)" gemsetname="$(echo "$gemset" | cut -d '@' -f 2)"
state_is="$(cat "$__object/explorer/state")" state_is="$(cat "$__object/explorer/state")"
user="$(cat "$__object/parameter/user")" user="$(cat "$__object/parameter/user")"
default="$(cat "$__object/parameter/default")" default="$(cat "$__object/parameter/default" 2>/dev/null || true)"
state_should="$(cat "$__object/parameter/state")" state_should="$(cat "$__object/parameter/state")"
if [ "$state_is" != "$state_should" ]; then if [ "$state_is" != "$state_should" ]; then
case "$state_should" in case "$state_should" in

View file

@ -21,8 +21,9 @@
ruby="$__object_id" ruby="$__object_id"
state_is="$(cat "$__object/explorer/state")" state_is="$(cat "$__object/explorer/state")"
user="$(cat "$__object/parameter/user")" user="$(cat "$__object/parameter/user")"
default="$(cat "$__object/parameter/default")" default="$(cat "$__object/parameter/default" 2>/dev/null || true)"
state_should="$(cat "$__object/parameter/state")" state_should="$(cat "$__object/parameter/state")"
if [ "$state_is" != "$state_should" ]; then if [ "$state_is" != "$state_should" ]; then
case "$state_should" in case "$state_should" in
present) present)