diff --git a/core/cli.py b/core/cli.py index 2b6312a..51b790d 100644 --- a/core/cli.py +++ b/core/cli.py @@ -29,6 +29,7 @@ class Command(Enum): RESET_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'reset_user.sh') REMOVE_USER = os.path.join(SCRIPT_DIR, 'hysteria2', 'remove_user.sh') SHOW_USER_URI = os.path.join(SCRIPT_DIR, 'hysteria2', 'show_user_uri.sh') + IP_ADD = os.path.join(SCRIPT_DIR, 'hysteria2', 'ip.sh') MANAGE_OBFS = os.path.join(SCRIPT_DIR, 'hysteria2', 'manage_obfs.sh') 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') @@ -266,6 +267,13 @@ def manage_obfs(remove, generate): else: click.echo("Error: Please specify either --remove or --generate.") +@cli.command('ip-address') +def run_ip_script(): + try: + run_cmd(['bash', Command.IP_ADD.value]) + except subprocess.CalledProcessError as e: + click.echo(f"Error while running IP script: {e.output.decode()}", err=True) + # endregion # region advanced menu