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