diff --git a/cdist/conf/type/__jail/manifest b/cdist/conf/type/__jail/manifest
index fad6a3a1..8f90ee4e 100755
--- a/cdist/conf/type/__jail/manifest
+++ b/cdist/conf/type/__jail/manifest
@@ -43,7 +43,7 @@ for property in *; do
set -- "$@" "--$property" "$(cat "$property")"
done
-if grep -q '^10\.' "$(cat "$__global/explorer/os_version")" ; then # Version is 10.x
+if grep -q '^[[:digit:]]\{2,\}\.' "$__global/explorer/os_version" ; then # Version > 9.x
__jail_freebsd10 "$@"
else
__jail_freebsd9 "$@"
diff --git a/cdist/conf/type/__jail_freebsd10/gencode-remote b/cdist/conf/type/__jail_freebsd10/gencode-remote
index 4f376c25..89dafe42 100755
--- a/cdist/conf/type/__jail_freebsd10/gencode-remote
+++ b/cdist/conf/type/__jail_freebsd10/gencode-remote
@@ -137,7 +137,7 @@ EOF
echo "rm -f \"/etc/fstab.${name}\""
# Remove jail entry from jail.conf
cat <<EOF
- sed -i .bak -E -e "/^${name} {\$/,/^}\\\$/d" /etc/jail.conf
+ sed -i .bak -e "/^${name} {$/,/^}$/d" /etc/jail.conf
binder@satyrine:~/cdist $ cat jail-fixes
+ cp -a ${jaildir}/base/var/* "${jaildir}/rw/${name}/var/"
fi
chmod 755 "${jaildir}/rw/${name}/var"
chmod 755 "${jaildir}/base/var"
@@ -208,11 +208,11 @@ cat <<EOF
fi
mkdir "${jaildir}/rw/${name}/home"
if [ -n "\$(ls ${jaildir}/base/usr/home)" ]; then
- cp -r ${jaildir}/base/usr/home/* "${jaildir}/rw/${name}/home/"
+ cp -a ${jaildir}/base/usr/home/* "${jaildir}/rw/${name}/home/"
fi
mkdir "${jaildir}/rw/${name}/root"
if [ -n "\$(ls -A ${jaildir}/base/root)" ]; then
- cp -r ${jaildir}/base/root/ "${jaildir}/rw/${name}/root/"
+ cp -a ${jaildir}/base/root/ "${jaildir}/rw/${name}/root/"
fi
EOF
@@ -351,7 +351,8 @@ if [ "$present" = "EXISTS" ]; then # The jail currently exists
exit 0
fi
else # The jail does not currently exist
- if [ "$state" = "absent" ]; then # The jail is not supposed to be present
+ if [ "$state" = "absent" ]; then # The jail is not supposed to be present
+ deleteJail
exit 0
else # The jail is supposed to exist
createJail