diff --git a/conf/type/__jail/gencode-local b/conf/type/__jail/gencode-local index 6292d943..075a6ef1 100755 --- a/conf/type/__jail/gencode-local +++ b/conf/type/__jail/gencode-local @@ -28,12 +28,26 @@ else jaildir="/usr/jail" fi -jailbase="$(cat "$__object/parameter/jailbase")" +if [ -f "$__object/parameter/jailbase" ]; then + jailbase="$(cat "$__object/parameter/jailbase")" +else + jailbase="" +fi + +state="$(cat "$__object/parameter/state")" + +if [ "$state" = "present" ] && [ -z "$jailbase" ]; then + exec >&2 + echo "jailbase is a REQUIRED parameter when state=present!" + exit 1 +fi remotebase="${jaildir}/jailbase.tgz" basepresent="$(cat "$__object/explorer/basepresent")" -if [ "$basepresent" = "NONE" ]; then - echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}" -fi +if [ "$state" = "present" ]; then + if [ "$basepresent" = "NONE" ]; then + echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}" + fi # basepresent=NONE +fi # state=present diff --git a/conf/type/__jail/gencode-remote b/conf/type/__jail/gencode-remote index 2db3fac0..62aa7b60 100755 --- a/conf/type/__jail/gencode-remote +++ b/conf/type/__jail/gencode-remote @@ -177,6 +177,7 @@ cat <