Files
pylibmeshctrl/tests/environment/scripts/meshcentral/create_users.py
Josiah Baldwin 12a3040f89 Reapply "Feat/run console commands"
This reverts commit 4cda54ab60.
2025-09-27 14:48:55 -07:00

15 lines
532 B
Python

import os
import subprocess
import json
thisdir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(thisdir, "users.json")) as infile:
users = json.load(infile)
for username, password in users.items():
print(subprocess.check_output(["node", "/opt/meshcentral/meshcentral", "--createaccount", username, "--pass", password, "--name", username]))
print(subprocess.check_output(["node", "/opt/meshcentral/meshcentral", "--adminaccount", "admin"]))
subprocess.call(["bash", "/opt/meshcentral/entrypoint.sh"])