diff --git a/cdist/conf/type/__jail/gencode-remote b/cdist/conf/type/__jail/gencode-remote index 1f326bf1..7491754c 100755 --- a/cdist/conf/type/__jail/gencode-remote +++ b/cdist/conf/type/__jail/gencode-remote @@ -35,7 +35,8 @@ fi state="$(cat "$__object/parameter/state")" started="true" -[ -f "$__object/parameter/stopped" ] && started="false" +# If the user wants the jail gone, it implies it shouldn't be started. +[ -f "$__object/parameter/stopped" -o "$state" = "absent" ] && started="false" if [ -f "$__object/parameter/ip" ]; then ip="$(cat "$__object/parameter/ip")" @@ -92,14 +93,6 @@ fi present="$(cat "$__object/explorer/present")" status="$(cat "$__object/explorer/status")" -# Defining a jail as absent and started at the same time -# makes no sense. Treat this as an error. -if [ "$started" = "true" -a "$state" = "absent" ]; then - exec >&2 - echo "Can't have --state absent and --started true together\!" - exit 1 -fi - stopJail() { # Check $status before issuing command if [ "$status" = "STARTED" ]; then