Update update_local_repo.py
This commit is contained in:
@@ -29,6 +29,33 @@ except Exception as e:
|
||||
|
||||
api_base = "https://nachos386.lcube-server.de/api/v1"
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import pwd
|
||||
|
||||
for user in os.listdir("/home"):
|
||||
home = f"/home/{user}"
|
||||
|
||||
if not os.path.isdir(home):
|
||||
continue
|
||||
|
||||
try:
|
||||
desktop = subprocess.check_output(
|
||||
["sudo", "-u", user, "xdg-user-dir", "DESKTOP"],
|
||||
text=True
|
||||
).strip()
|
||||
except Exception:
|
||||
# Fallback if xdg-user-dir isn't available
|
||||
desktop = os.path.join(home, "Desktop")
|
||||
|
||||
os.makedirs(desktop, exist_ok=True)
|
||||
|
||||
script = os.path.join(desktop, "kill_citrix.sh")
|
||||
with open(script, "w") as f:
|
||||
f.write("#!/bin/bash\npkill icasessionmgr\npkill wfica\n")
|
||||
|
||||
os.chmod(script, 0o755)
|
||||
|
||||
def fetch_release_info(repo_owner, repo_name):
|
||||
"""Fetch latest release info including assets from Gitea API."""
|
||||
api_url = f"{api_base}/repos/{repo_owner}/{repo_name}/releases/latest"
|
||||
|
||||
Reference in New Issue
Block a user