From ac75cd3c284d7d711cbeda5eee56735bdccebd2f Mon Sep 17 00:00:00 2001 From: Jip-Hop <2871973+Jip-Hop@users.noreply.github.com> Date: Sat, 2 Mar 2024 17:34:55 +0100 Subject: [PATCH] Add --start flag for create command --- jlmkr.py | 6 ++++++ templates/docker/README.md | 2 +- templates/incus/README.md | 2 +- templates/lxd/README.md | 2 +- templates/podman/README.md | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jlmkr.py b/jlmkr.py index 1613c98..5d62e66 100755 --- a/jlmkr.py +++ b/jlmkr.py @@ -1192,6 +1192,7 @@ def create_jail(**kwargs): if not check_jail_name_available(jail_name): return 1 + start_now = kwargs.pop("start", start_now) jail_config_path = kwargs.pop("config") config = KeyValueParser() @@ -1928,6 +1929,11 @@ def main(): ) commands["create"].add_argument("--distro") commands["create"].add_argument("--release") + commands["create"].add_argument( + "--start", # + help="start jail after create", + action="store_true", + ) commands["create"].add_argument( "--startup", type=int, diff --git a/templates/docker/README.md b/templates/docker/README.md index b7e0764..17a5b5b 100644 --- a/templates/docker/README.md +++ b/templates/docker/README.md @@ -2,4 +2,4 @@ ## Setup -Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/docker/config mydockerjail`. \ No newline at end of file +Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/docker/config mydockerjail`. \ No newline at end of file diff --git a/templates/incus/README.md b/templates/incus/README.md index 70cc801..72d7339 100644 --- a/templates/incus/README.md +++ b/templates/incus/README.md @@ -6,7 +6,7 @@ ## Setup -Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/incus/config myincusjail`. +Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/incus/config myincusjail`. Unfortunately incus doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail: diff --git a/templates/lxd/README.md b/templates/lxd/README.md index baa24cb..185a16f 100644 --- a/templates/lxd/README.md +++ b/templates/lxd/README.md @@ -6,7 +6,7 @@ ## Setup -Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/lxd/config mylxdjail`. +Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/lxd/config mylxdjail`. Unfortunately snapd doesn't want to install from the `initial_setup` script inside the config file. So we manually finish the setup by running the following after creating and starting the jail: diff --git a/templates/podman/README.md b/templates/podman/README.md index dba7fbd..4e28d24 100644 --- a/templates/podman/README.md +++ b/templates/podman/README.md @@ -2,7 +2,7 @@ ## Setup -Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --config /mnt/tank/path/to/podman/config mypodmanjail`. +Check out the [config](./config) template file. You may provide it when asked during `jlmkr create` or, if you have the template file stored on your NAS, you may provide it directly by running `jlmkr create --start --config /mnt/tank/path/to/podman/config mypodmanjail`. ## Rootless