Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed work for amidaware/community-scripts#245 #1980

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/tacticalrmm/scripts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ def load_community_scripts(cls):

args = script["args"] if "args" in script.keys() else []

env = script["env"] if "env" in script.keys() else []

syntax = script["syntax"] if "syntax" in script.keys() else ""

run_as_user = (
script["run_as_user"] if "run_as_user" in script.keys() else False
)

supported_platforms = (
script["supported_platforms"]
if "supported_platforms" in script.keys()
Expand All @@ -135,7 +141,9 @@ def load_community_scripts(cls):
i.shell = script["shell"]
i.default_timeout = default_timeout
i.args = args
i.env_vars = env
i.syntax = syntax
i.run_as_user = run_as_user
i.filename = script["filename"]
i.supported_platforms = supported_platforms

Expand Down Expand Up @@ -163,8 +171,10 @@ def load_community_scripts(cls):
category=category,
default_timeout=default_timeout,
args=args,
env_vars=env,
filename=script["filename"],
syntax=syntax,
run_as_user=run_as_user,
supported_platforms=supported_platforms,
)
# new_script.hash_script_body() # also saves script
Expand Down
Loading