Saving config from archive to tempfile in order to source it

This commit is contained in:
erdgeist 2008-06-01 01:22:05 +00:00
parent 6c44af6f90
commit 5315494529

View File

@ -951,6 +951,13 @@ restore)
[ "${ezjail_hsname}" != "${ezjail_nameprop_hsname}" ] && exerr "Error: Archive was created on host named ${ezjail_hsname}. Can only use restore on the same machine. Consider using \"ezjail-admin create -a\" when migrating ezjails."
[ "${ezjail_hscpu}" != "${ezjail_nameprop_hscpu}" ] && exerr "Error: Archive was created on a different CPU. Can not restore. Consider using \"ezjail-admin create -a\" when migrating ezjails."
# Save config to tempfile and source it
tmpfile=`mktemp /tmp/ezjail.prop.XXXXXXXX`
[ $? -ne 0 ] && exerr "Error: Can't create temporary file."
pax -rzn -s:${ezjail_nameprop}:${tmpfile}: -f ${ezjail_fromarchive} ${ezjail_nameprop}
. "${tmpfile}"
rm -f "${tmpfile}"
shift 1
done
;;