mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Improving ynh_lxc_reset
This commit is contained in:
parent
6c0d35f5b9
commit
81b89dc3ce
1 changed files with 2 additions and 8 deletions
10
lib/ynh_lxd
10
lib/ynh_lxd
|
@ -491,15 +491,9 @@ ynh_lxc_reset () {
|
|||
then
|
||||
# Remove swap files before deleting the container
|
||||
ynh_lxc_swapfiles_clean --name=$name
|
||||
fi
|
||||
|
||||
ynh_lxc_stop --name=$name
|
||||
|
||||
if ynh_lxc_exists --name=$name
|
||||
then
|
||||
ynh_lxc_stop --name=$name
|
||||
local current_storage=$(lxc list $name --format json --columns b | jq '.[].expanded_devices.root.pool')
|
||||
swapoff "$(lxc storage get $current_storage source)/containers/$name/rootfs/swap" 2>/dev/null
|
||||
ynh_lxc_delete --name=$name
|
||||
fi
|
||||
|
||||
lxc delete $name --force 2>/dev/null
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue