Commit f99c7aa5 by Serge Hallyn Committed by Stéphane Graber

lxc-create: refuse to use a custom rootfs (--dir) which already exists.

parent 0749e740
...@@ -313,6 +313,10 @@ if [ -n "$custom_rootfs" ]; then ...@@ -313,6 +313,10 @@ if [ -n "$custom_rootfs" ]; then
echo "configuration file already specifies a lxc.rootfs" echo "configuration file already specifies a lxc.rootfs"
exit 1 exit 1
fi fi
if [ -d "$custom_rootfs" ]; then
echo "specified rootfs ($custom_rootfs) already exists. Bailing."
exit 1
fi
echo "lxc.rootfs = $custom_rootfs" >> $lxc_path/$lxc_name/config echo "lxc.rootfs = $custom_rootfs" >> $lxc_path/$lxc_name/config
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment