diff --git a/src/jlmkr/actions/startup.py b/src/jlmkr/actions/startup.py new file mode 100644 index 0000000..8314f8a --- /dev/null +++ b/src/jlmkr/actions/startup.py @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers +# +# SPDX-License-Identifier: LGPL-3.0-only + +from actions.start import start_jail +from utils.dataset import get_all_jail_names, get_jail_config_path +from utils.config_parser import parse_config_file + + +def startup_jails(): + start_failure = False + for jail_name in get_all_jail_names(): + config = parse_config_file(get_jail_config_path(jail_name)) + if config and config.my_getboolean("startup"): + if start_jail(jail_name) != 0: + start_failure = True + + if start_failure: + return 1 + + return 0 diff --git a/src/jlmkr/donor/jlmkr.py b/src/jlmkr/donor/jlmkr.py index 8fa2a5f..12110ee 100755 --- a/src/jlmkr/donor/jlmkr.py +++ b/src/jlmkr/donor/jlmkr.py @@ -95,20 +95,7 @@ from actions.remove import remove_jail from utils.dataset import get_all_jail_names, parse_os_release from actions.list import list_jails - - -def startup_jails(): - start_failure = False - for jail_name in get_all_jail_names(): - config = parse_config_file(get_jail_config_path(jail_name)) - if config and config.my_getboolean("startup"): - if start_jail(jail_name) != 0: - start_failure = True - - if start_failure: - return 1 - - return 0 +from actions.startup import startup_jails def split_at_string(lst, string):