Update pve RustDesk GA sync scripts

This commit is contained in:
alexveley
2026-06-24 02:15:18 -04:00
parent f1f9daf290
commit 8a79b0bc73
+19 -19
View File
@@ -222,25 +222,25 @@ def guest_file_read(vmid: int, guest_path: str) -> tuple[str | None, str | None]
def read_rustdesk_id_cli(vmid: int) -> tuple[str | None, str | None]:
attempts = [
([RUSTDESK_EXE, '--get-id'], 'direct'),
(['cmd.exe', '/c', f'"{RUSTDESK_EXE} --get-id"'], 'cmd'),
(
[
'powershell.exe', '-NoProfile', '-NonInteractive', '-Command',
"$ProgressPreference='SilentlyContinue'; & 'C:\\Program Files\\RustDesk\\rustdesk.exe' --get-id",
],
'powershell',
),
]
errors: list[str] = []
for command, label in attempts:
rid, err = guest_exec_text(vmid, command, timeout=45)
if rid and re.fullmatch(r'\d{6,12}', rid):
log(f'VM {vmid}: ID {rid} from rustdesk --get-id ({label})')
return rid, None
errors.append(f'{label}: {err or "no id"}')
return None, errors[-1] if errors else 'rustdesk --get-id failed'
attempts = [
([RUSTDESK_EXE, '--get-id'], 'direct'),
(['cmd.exe', '/c', f'"{RUSTDESK_EXE} --get-id"'], 'cmd'),
(
[
'powershell.exe', '-NoProfile', '-NonInteractive', '-Command',
"$ProgressPreference='SilentlyContinue'; & 'C:\\Program Files\\RustDesk\\rustdesk.exe' --get-id",
],
'powershell',
),
]
errors: list[str] = []
for command, label in attempts:
rid, err = guest_exec_text(vmid, command, timeout=45)
if rid and re.fullmatch(r'\d{6,12}', rid):
log(f'VM {vmid}: ID {rid} from rustdesk --get-id ({label})')
return rid, None
errors.append(f'{label}: {err or "no id"}')
return None, errors[-1] if errors else 'rustdesk --get-id failed'
def read_rustdesk_id_report(vmid: int) -> tuple[str | None, str | None]: