From 9b555d6e41a68fea9210f6466a154413694c60f9 Mon Sep 17 00:00:00 2001 From: cryx Date: Fri, 15 Jan 2010 14:34:00 +0000 Subject: Fix restoring zfs jails, they don't necessarily have a size so the ezjail-admin create command has to be invoked without the -s option. --- ezjail-admin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ezjail-admin b/ezjail-admin index d3cc9c7..3ca6fe8 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -1169,7 +1169,9 @@ restore) # Now all parameters are here, invoke ezjail-admin create [ "${ezjail_rootdir}" -a "${ezjail_ips}" -a "${ezjail_hostname}" ] || exerr "Error: Archive does not contain a valid ezjail properties file.\n Some jails properties are missing." - [ "${ezjail_imagetype}" ] && ezjail_imagedata="-c ${ezjail_imagetype} -C '${ezjail_attachparams}' -s ${ezjail_nameprop_imgagesize}" + # Setup the ezjail_imagedata. Only use the imagesize if we really have one, ZFS imagejails don't necessarily have a size. + [ "${ezjail_imagetype}" -a ${ezjail_nameprop_imgagesize} ] && ezjail_imagedata="-c ${ezjail_imagetype} -C '${ezjail_attachparams}' -s ${ezjail_nameprop_imgagesize}" + [ "${ezjail_imagetype}" ] && ezjail_imagedata="-c ${ezjail_imagetype} -C '${ezjail_attachparams}'" $0 create -a "${ezjail_fromarchive}" -A "${ezjail_config}" ${ezjail_imagedata} -r "${ezjail_rootdir}" "${ezjail_hostname}" "${ezjail_ips}" || exerr "Error: Create failed." rm -f "${ezjail_config}" -- cgit v1.2.3