s5启动文件配置
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import ipaddress
|
||||
|
||||
|
||||
def generate_commands(start_port, start_subnet, start_ip, count):
|
||||
ip = ipaddress.ip_address(start_ip)
|
||||
commands = []
|
||||
|
||||
for i in range(count):
|
||||
port = start_port + i
|
||||
subnet_num = 65 + i # 从 10.65.0.0/16 开始
|
||||
subnet = f"10.{subnet_num}.0.0/16"
|
||||
gateway = f"10.{subnet_num}.0.1"
|
||||
use_ip = str(ip + i)
|
||||
|
||||
cmd = (f"nohup ./s5_multi_1.0.1 -listen \"{port}={use_ip}\" "
|
||||
f"-report=true "
|
||||
f"> /root/socket5_1.0.1/{port}.log 2>&1 &")
|
||||
commands.append(cmd)
|
||||
return commands
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 参数配置
|
||||
START_PORT = 25715
|
||||
START_IP = "45.86.235.163"
|
||||
COUNT = 20
|
||||
|
||||
cmds = generate_commands(START_PORT, 65, START_IP, COUNT)
|
||||
for c in cmds:
|
||||
print(c)
|
||||
Reference in New Issue
Block a user