Skip to content

Commit b3384a0

Browse files
committed
Remove dependency to get-output-tries
1 parent 7fc7806 commit b3384a0

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

nxc/modules/schtask_as.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,18 @@ def on_admin_login(self, context, connection):
222222
self.logger.fail(f"Error deleting {self.output_file_location}{self.binary_to_upload_name} on {self.share}: {e}")
223223

224224
if self.ca_name and self.template_name:
225-
226225
dump_path = path.join(NXC_PATH, "modules/schtask_as")
227226
if not path.isdir(dump_path):
228227
makedirs(dump_path)
229228

230-
# Polling loop to wait for the PFX to be ready (avoid fixed sleep)
231-
max_wait_seconds = getattr(connection.args, "get_output_tries", 60)
232-
233229
pfx_local_path = path.join(dump_path, f"{self.run_task_as}.pfx")
234230
pfx_remote_path = f"{self.output_file_location}\\{self.output_filename}.pfx"
235231

236-
self.logger.debug(f"Waiting up to {max_wait_seconds}s for remote PFX: {pfx_remote_path}")
237-
232+
# Polling loop to wait for the PFX to be ready (avoid fixed sleep)
238233
pfx_fetched = False
239234
last_exception = None
235+
max_wait_seconds = 60
236+
self.logger.debug(f"Waiting up to {max_wait_seconds}s for remote PFX: {pfx_remote_path}")
240237
for second in range(max_wait_seconds):
241238
try:
242239
# try to download; open local file only on success

0 commit comments

Comments
 (0)