Saving config from archive to tempfile in order to source it
This commit is contained in:
parent
6c44af6f90
commit
5315494529
@ -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_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."
|
[ "${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
|
shift 1
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user