Changed compatibility

This commit is contained in:
2025-07-21 22:42:16 +02:00
parent 07d0b99c47
commit 615a438003
+19 -19
View File
@@ -21,22 +21,22 @@ async def init_connection(credentials: dict) -> meshctrl.Session:
Use the libmeshctrl library to initiate a Secure Websocket (wss) connection to the MeshCentral instance. Use the libmeshctrl library to initiate a Secure Websocket (wss) connection to the MeshCentral instance.
''' '''
if configuration["totp_secret"]: if "totp_secret" in credentials:
totp = pyotp.TOTP(configuration["totp_secret"]) totp = pyotp.TOTP(credentials["totp_secret"])
otp = totp.now() otp = totp.now()
session = meshctrl.Session( session = meshctrl.Session(
configuration['hostname'], credentials['hostname'],
user=configuration['username'], user=credentials['username'],
password=configuration['password'], password=credentials['password'],
token=otp token=otp
) )
else: else:
session = meshctrl.Session( session = meshctrl.Session(
configuration['hostname'], credentials['hostname'],
user=configuration['username'], user=credentials['username'],
password=configuration['password'] password=credentials['password']
) )
await session.initialized.wait() await session.initialized.wait()
return session return session
@@ -181,7 +181,7 @@ async def main():
console.nice_print(args, console.nice_print(args,
console.text_color.reset + "MeshBook Version: " + console.text_color.yellow + str(meshbook_version)) console.text_color.reset + "MeshBook Version: " + console.text_color.yellow + str(meshbook_version))
return return
if not args.meshbook: if not args.meshbook:
parser.print_help() parser.print_help()
return return
@@ -216,7 +216,7 @@ async def main():
else: else:
console.nice_print(args, console.nice_print(args,
"Target Operating System category given: " + console.text_color.yellow + "All" + console.text_color.reset + ".") "Target Operating System category given: " + console.text_color.yellow + "All" + console.text_color.reset + ".")
# Should Meshbook ignore categorisation? # Should Meshbook ignore categorisation?
if "ignore_categorisation" in meshbook: if "ignore_categorisation" in meshbook:
console.nice_print(args, console.nice_print(args,
@@ -230,7 +230,7 @@ async def main():
else: else:
console.nice_print(args, console.nice_print(args,
"Ignore the OS Categorisation file: " + console.text_color.yellow + "False" + console.text_color.reset + ".") "Ignore the OS Categorisation file: " + console.text_color.yellow + "False" + console.text_color.reset + ".")
# TARGET TAG PRINTING # TARGET TAG PRINTING
if "target_tag" in meshbook: if "target_tag" in meshbook:
console.nice_print(args, console.nice_print(args,