mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Implement ynh_lxc_delete
This commit is contained in:
parent
ffa77e8e61
commit
7af7f02a74
1 changed files with 22 additions and 0 deletions
22
lib/ynh_lxd
22
lib/ynh_lxd
|
@ -308,6 +308,28 @@ ynh_lxc_launch (){
|
|||
fi
|
||||
}
|
||||
|
||||
# Delete a lxc container
|
||||
#
|
||||
# usage: ynh_lxc_delete --name=name
|
||||
# | arg: -n, --name= - name of the LXC
|
||||
#
|
||||
# Requires YunoHost version *.*.* or higher.
|
||||
ynh_lxc_delete () {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=n
|
||||
local -A args_array=([n]=name=)
|
||||
local name
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
|
||||
if ynh_lxc_exists --name=$name
|
||||
then
|
||||
lxc delete $name --force
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Clean the swapfiles of an LXC container
|
||||
#
|
||||
# usage: ynh_lxc_swapfiles_clean --name=name
|
||||
|
|
Loading…
Add table
Reference in a new issue