[fix] get the current storage of a container instead of using "default"

This commit is contained in:
Kay0u 2022-07-05 14:22:29 +02:00
parent 7c295fa65d
commit 98c00ed402
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -131,7 +131,8 @@ LXC_RESET () {
LXC_STOP $LXC_NAME
swapoff "$(lxc storage get default source)/containers/$LXC_NAME/rootfs/swap" 2>/dev/null
local current_storage=$(lxc list $LXC_NAME --format json --columns b | jq '.[].expanded_devices.root.pool')
swapoff "$(lxc storage get $current_storage source)/containers/$LXC_NAME/rootfs/swap" 2>/dev/null
lxc delete $LXC_NAME --force 2>/dev/null
}