Fix links

This commit is contained in:
Penguinehis
2026-09-29 10:18:56 -03:00
parent b4a8a70e54
commit 4673f8c58e
6 changed files with 88 additions and 33 deletions
+14 -1
View File
@@ -815,6 +815,16 @@ def logs():
subprocess.run(["journalctl", "-u", SERVICE, "-n", "80", "--no-pager"])
def update_from_git():
updater = INSTALL_DIR / "update.sh"
if not updater.is_file():
raise CLIError(f"Updater missing: {updater}")
result = subprocess.run(["bash", str(updater)], check=False)
if result.returncode:
raise CLIError(f"Update failed (exit {result.returncode}); see the output above")
print("Update complete. Reopen menu to load the updated CLI.")
def render_menu(title, options, vps_status=None, columns=None):
cols = columns or terminal_columns()
width = min(48, max(20, cols - 2))
@@ -908,13 +918,14 @@ def main_menu_options():
"6": ("API password (view / rotate)", api_menu),
"7": ("Recent logs", logs),
"8": ("Restart service", lambda: service_action("restart")),
"9": ("Update from Git", lambda: update_from_git() if confirm("Update from Git now?") else None),
}
def main():
parser = argparse.ArgumentParser(description="DragonCoreSSH CLI administration")
parser.add_argument("--mobile", action="store_true", help="force a 40-column phone layout")
parser.add_argument("command", nargs="?", choices=("menu", "status", "users", "api-password", "logs"), default="menu")
parser.add_argument("command", nargs="?", choices=("menu", "status", "users", "api-password", "logs", "update"), default="menu")
parser.add_argument("action", nargs="?", choices=("show", "change"))
args = parser.parse_args()
require_root()
@@ -935,6 +946,8 @@ def main():
status()
elif args.command == "logs":
logs()
elif args.command == "update":
update_from_git()
else:
menu("MAIN MENU", main_menu_options())