diff --git a/src/utils/lxc_commands_utils.py b/src/utils/lxc_commands_utils.py index 400fa83..47c6adc 100644 --- a/src/utils/lxc_commands_utils.py +++ b/src/utils/lxc_commands_utils.py @@ -17,6 +17,11 @@ def run_script(lxc, step): Typically read from the "creation/steps/" in JSON file """ + # Install bash if not installed + # Sometimes only ash or sh are installed, which doesn't work for some scripts + if not lxc.has_program("bash"): + install_package(lxc, "bash") + # Run local script if "path" in step: _run_local_script_on_lxc(lxc, step["path"]) @@ -42,7 +47,7 @@ def _run_local_script_on_lxc(lxc, path: "Path to the script on the machine runni path = get_path(lxc, path) with open(path, "r") as file: script = file.read() - lxc.run_command("'bash -s' <<'ENDSSH'\n" + script) + lxc.run_command("bash <