From 003c139597b93b649b688181781d3eb326bb18bf Mon Sep 17 00:00:00 2001 From: Andrew Case Date: Mon, 24 Mar 2025 15:10:37 +0000 Subject: [PATCH] Add a --script-only flag that exits after the given volshell script is completed --- volatility3/cli/volshell/generic.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/volatility3/cli/volshell/generic.py b/volatility3/cli/volshell/generic.py index 143e26500..2f7c7662c 100644 --- a/volatility3/cli/volshell/generic.py +++ b/volatility3/cli/volshell/generic.py @@ -60,7 +60,13 @@ class Volshell(interfaces.plugins.PluginInterface): description="File to load and execute at start", default=None, optional=True, - ) + ), + requirements.BooleanRequirement( + name="script-only", + description="Exit volshell after the script specified in --script completes", + default=False, + optional=True, + ), ] return reqs + [ requirements.TranslationLayerRequirement( @@ -135,6 +141,9 @@ class Volshell(interfaces.plugins.PluginInterface): if self.config.get("script", None) is not None: self.run_script(location=self.config["script"]) + if self.config.get("script-only"): + exit() + if has_ipython: self.__console() else: