mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Improving ynh_lxc_snapshot_load
This commit is contained in:
parent
fc3d11791e
commit
6c0d35f5b9
1 changed files with 11 additions and 6 deletions
17
lib/ynh_lxd
17
lib/ynh_lxd
|
@ -456,15 +456,20 @@ ynh_lxc_snapshot_load () {
|
||||||
# Manage arguments with getopts
|
# Manage arguments with getopts
|
||||||
ynh_handle_getopts_args "$@"
|
ynh_handle_getopts_args "$@"
|
||||||
|
|
||||||
log_debug "Loading snapshot $snapname ..."
|
if ynh_lxc_snapshot_exists --name="$name" --snapname="$snapname"
|
||||||
|
then
|
||||||
|
log_debug "Loading snapshot $snapname ..."
|
||||||
|
|
||||||
# Remove swap files before restoring the snapshot.
|
# Remove swap files before restoring the snapshot.
|
||||||
ynh_lxc_swapfiles_clean --name=$name
|
ynh_lxc_swapfiles_clean --name=$name
|
||||||
|
|
||||||
ynh_lxc_stop --name=$name
|
ynh_lxc_stop --name=$name
|
||||||
|
|
||||||
lxc restore $name $snapname
|
lxc restore $name $snapname
|
||||||
_ynh_lxc_start_and_wait --name=$name
|
_ynh_lxc_start_and_wait --name=$name
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reset an LXC container
|
# Reset an LXC container
|
||||||
|
|
Loading…
Add table
Reference in a new issue