Refactor: Implement TCP Brutal installation in Python

This commit is contained in:
Whispering Wind
2025-05-05 23:31:14 +03:30
committed by GitHub
parent b8e6a5475b
commit ce4d23d18e
3 changed files with 17 additions and 8 deletions

View File

@ -42,7 +42,7 @@ class Command(Enum):
SHELL_SINGBOX = os.path.join(SCRIPT_DIR, 'singbox', 'singbox_shell.sh')
SHELL_WEBPANEL = os.path.join(SCRIPT_DIR, 'webpanel', 'webpanel_shell.sh')
INSTALL_NORMALSUB = os.path.join(SCRIPT_DIR, 'normalsub', 'normalsub.sh')
INSTALL_TCP_BRUTAL = os.path.join(SCRIPT_DIR, 'tcp-brutal', 'install.sh')
INSTALL_TCP_BRUTAL = os.path.join(SCRIPT_DIR, 'tcp-brutal', 'install.py')
INSTALL_WARP = os.path.join(SCRIPT_DIR, 'warp', 'install.py')
UNINSTALL_WARP = os.path.join(SCRIPT_DIR, 'warp', 'uninstall.py')
CONFIGURE_WARP = os.path.join(SCRIPT_DIR, 'warp', 'configure.py')
@ -431,7 +431,7 @@ def update_geo(country: str):
def install_tcp_brutal():
'''Installs TCP Brutal.'''
run_cmd(['bash', Command.INSTALL_TCP_BRUTAL.value])
run_cmd(['python3', Command.INSTALL_TCP_BRUTAL.value])
def install_warp():

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import os
import subprocess
def main():
print("Installing TCP Brutal...")
subprocess.run("bash -c \"$(curl -fsSL https://tcp.hy2.sh/)\"", shell=True)
os.system('clear')
print("TCP Brutal installation complete.")
if __name__ == "__main__":
main()

View File

@ -1,6 +0,0 @@
#!/bin/bash
echo "Installing TCP Brutal..."
bash <(curl -fsSL https://tcp.hy2.sh/)
sleep 3
clear
echo "TCP Brutal installation complete."