swmodd: fix lxc uninstallation

This commit is contained in:
suvendhu 2023-11-29 18:00:38 +05:30 committed by Vivek Kumar Dutta
parent 6dfd959020
commit 17e67528cc
No known key found for this signature in database
GPG key ID: 65C818099F37097D

View file

@ -16,13 +16,14 @@ is_container_running() {
configure_lxc_container() {
local requested_state name ctype du_status BUNDLE
local requested_state name ctype du_status BUNDLE section
ctype="${1}"
name="${2}"
requested_state="${3}"
du_state="${4}"
du_status="${4}"
BUNDLE="${5}"
section="${6}"
if [ "${ctype}" != "lxc" ]; then
return 0;
@ -33,6 +34,8 @@ configure_lxc_container() {
if [ -d "${BUNDLE:?}/${name:?}" ]; then
rm -rf "${BUNDLE:?}/${name:?}"
fi
uci_remove ocicontainer "${section}"
return 0;
fi
if [ "${requested_state}" = "Idle" ]; then
@ -66,7 +69,7 @@ configure_crun_container() {
fi
if [ "${type}" != "crun" ]; then
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}"
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}" "${1}"
return 0;
fi