}
verify_zfs() {
- if which zfs >/dev/null 2>&1 && zfs get all "$zfs_root" >/dev/null 2>&1; then
+ if which zfs >/dev/null 2>&1 && zfs get all "$zfsroot" >/dev/null 2>&1; then
echo zfs
else
echo no
;;
--zfsroot)
optarg_check $opt "$1"
- zfs_root=$1
+ zfsroot=$1
shift
;;
--)
lvname="$lxc_name"
fi
-if [ -z "$zfs_root" ]; then
- zfs_root="tank/lxc"
+if [ -z "$zfsroot" ]; then
+ zfsroot="tank/lxc"
fi
if [ "$(id -u)" != "0" ]; then
;;
zfs)
if [ `verify_zfs` != 'zfs' ]; then
- echo "missing 'zfs' command or $zfs_root is not zfs" >&2
+ echo "missing 'zfs' command or $zfsroot is not zfs" >&2
exit 1
fi
;;
elif [ "$backingstore" = "btrfs" ]; then
btrfs subvolume delete "$rootfs" || true
elif [ "$backingstore" = "zfs" ]; then
- zfs destroy "$zfs_root/$lxc_name" || true
+ zfs destroy "$zfsroot/$lxc_name" || true
fi
${bindir}/lxc-destroy -n $lxc_name -P "$lxc_path"
# set up container dir per backing store
if [ "$backingstore" = "zfs" ]; then
- zfs create -omountpoint=$lxc_path/$lxc_name/rootfs "$zfs_root/$lxc_name"
+ zfs create -omountpoint=$lxc_path/$lxc_name/rootfs "$zfsroot/$lxc_name"
elif [ "$backingstore" = "btrfs" ]; then
mkdir "$lxc_path/$lxc_name"
if ! out=$(btrfs subvolume create "$rootfs" 2>&1); then