diff --git a/swmodd/Makefile b/swmodd/Makefile index df0aab6cc..50a2e4c48 100755 --- a/swmodd/Makefile +++ b/swmodd/Makefile @@ -5,13 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=swmodd -PKG_VERSION:=2.3.3 +PKG_VERSION:=2.4.0 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git -PKG_SOURCE_VERSION:=f73adba35daa8e24b7f28dc73eb58f53761a0d3b +PKG_SOURCE_VERSION:=cd1b40094b46e8223d13253e4bc41a8a2f000cf1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip endif diff --git a/swmodd/files/etc/init.d/crun b/swmodd/files/etc/init.d/crun index cfd77ec2f..2cf5eb221 100644 --- a/swmodd/files/etc/init.d/crun +++ b/swmodd/files/etc/init.d/crun @@ -14,6 +14,34 @@ is_container_running() { return $? } + +configure_lxc_container() { + local requested_state name ctype du_status BUNDLE + + ctype="${1}" + name="${2}" + requested_state="${3}" + du_state="${4}" + BUNDLE="${5}" + + if [ "${ctype}" != "lxc" ]; then + return 0; + fi + + if [ "${du_status}" = "Uninstalling" ]; then + lxc-stop -q -k "${name}" + if [ -d "${BUNDLE:?}/${name:?}" ]; then + rm -rf "${BUNDLE:?}/${name:?}" + fi + fi + + if [ "${requested_state}" = "Idle" ]; then + lxc-stop -q -k "${name}" + elif [ "${requested_state}" = "Active" ]; then + lxc-start -q "${name}" >/dev/null 2>&1 + fi +} + configure_crun_container() { local name type autostart du_status requested_state url username password local BRIDGE BUNDLE BOOT @@ -38,6 +66,7 @@ configure_crun_container() { fi if [ "${type}" != "crun" ]; then + configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}" return 0; fi