Fix links
This commit is contained in:
+14
-1
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user