diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-10-29 00:21:41 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-10-29 00:21:41 +0800 |
| commit | 7ab30ab3ee572de1be2afc3083e4a28b594b1cba (patch) | |
| tree | f65683c722d0abc30a17a9a8e4485f9ec5fd1f8b /debian-container/debian-container.sh | |
| parent | 4e6376cfc58e73fc14ddb691c0fac9da425efac9 (diff) | |
| download | rutils-7ab30ab3ee572de1be2afc3083e4a28b594b1cba.tar.gz rutils-7ab30ab3ee572de1be2afc3083e4a28b594b1cba.tar.xz | |
Add named container instances with exec, status, list, and delete commands.
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'debian-container/debian-container.sh')
| -rwxr-xr-x | debian-container/debian-container.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/debian-container/debian-container.sh b/debian-container/debian-container.sh index 893d83b..5838fde 100755 --- a/debian-container/debian-container.sh +++ b/debian-container/debian-container.sh @@ -26,18 +26,35 @@ esac dc_require_root case "$DC_ACTION" in - base-create|init|enter|delete) + base-create|init|enter|exec|delete) # 防止多个会话同时读写同一 ext4 镜像。 dc_acquire_lock ;; esac case "$DC_ACTION" in + init|enter|exec|status|delete) + (($# > 0)) || dc_die "$DC_ACTION 需要实例名称。" + dc_select_instance "$1" + shift + ;; + _init|_enter|_exec) + (($# > 0)) || dc_die "$DC_ACTION 需要实例名称。" + dc_select_instance "$1" + shift + ;; +esac + +case "$DC_ACTION" in base-create) dc_base_create "$@" ;; init) dc_init "$@" ;; _init) dc_init_rootfs "$@" ;; - enter) dc_enter ;; + enter) dc_enter "$@" ;; _enter) dc_enter_rootfs ;; + exec) dc_exec "$@" ;; + _exec) dc_exec_rootfs "$@" ;; + status) dc_status ;; + list) dc_list ;; delete) dc_delete ;; *) dc_usage >&2 |
