From eebd58b52ff2a2f86a925dc0ef3f2638d7243470 Mon Sep 17 00:00:00 2001 From: Night Owl <176560581+ShadowOwlCode@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:23:47 +0330 Subject: [PATCH] Added backup hysteria --- core/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/cli.py b/core/cli.py index 913796b..bf87d1b 100644 --- a/core/cli.py +++ b/core/cli.py @@ -31,6 +31,7 @@ class Command(Enum): TRAFFIC_STATUS = 'traffic.py' # won't be call directly (it's a python module) LIST_USERS = os.path.join(SCRIPT_DIR, 'hysteria2', 'list_users.sh') SERVER_INFO = os.path.join(SCRIPT_DIR, 'hysteria2', 'server_info.sh') + BACKUP_HYSTERIA = os.path.join(SCRIPT_DIR, 'hysteria2', 'backup.sh') INSTALL_TELEGRAMBOT = os.path.join(SCRIPT_DIR, 'telegrambot', 'runbot.sh') INSTALL_SINGBOX = os.path.join(SCRIPT_DIR, 'singbox', 'singbox_shell.sh') INSTALL_TCP_BRUTAL = os.path.join(SCRIPT_DIR, 'tcp-brutal', 'install.sh') @@ -224,6 +225,14 @@ def server_info(): output = run_cmd(['bash', Command.SERVER_INFO.value]) if output: print(output) + +@cli.command('backup-hysteria') +def backup_hysteria(): + try: + run_cmd(['bash', Command.BACKUP_HYSTERIA.value]) + except subprocess.CalledProcessError as e: + click.echo(f"Backup failed: {e.output.decode()}", err=True) + # endregion # region advanced menu