__postgres_role: check if state parameter exists before reading it

This commit is contained in:
nuex 2013-06-17 11:16:26 -04:00
parent dc39099730
commit 48b6344645

View file

@ -20,8 +20,8 @@
name="$__object_id"
state_is="$(cat "$__object/explorer/state")"
state_should="$(cat "$__object/parameter/state")"
[ ! "$state_should" ] && state_should="present"
state_should="present"
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
[ "$state_is" = "$state_should" ] && exit 0