s5启动文件配置

This commit is contained in:
leon_mac
2025-11-14 23:38:58 +08:00
parent d8b738d0b7
commit 86ce9cda87
9 changed files with 223 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from proxy_line.write_file import writ_json_file
if __name__ == '__main__':
root_path= "/Users/leonbob/workspace/project/langtu/lt/jsq/server-setting/new"
# 目标起始 ip
target_ip = "172.16.0.11"
# 文件起始序号
sart_index_num = 161
# 起始监听端口号
start_listen_port = 5715
# 文件总数
file_total_count = 20
writ_json_file(root_path, sart_index_num, file_total_count, target_ip, start_listen_port)
+11
View File
@@ -0,0 +1,11 @@
# insert into ss2_migrated.ip_port_allocation ( ip_address, port, is_used, group_purchase_id, last_used_at, created_at, updated_at, max_connections, current_connections, type)
# values ( '103.6.221.91', 5663, 0, 0,now(), now(), now(), 1, 0, 'group_purchase')
if __name__ == '__main__':
line_count = 52
start_port = 5663
start_ip = '103.6.221.91'
print("insert into ss2_migrated.ip_port_allocation ( ip_address, port, is_used, group_purchase_id, last_used_at, created_at, updated_at, max_connections, current_connections, type) values ")
for i in range(0, line_count):
print(f" ( '{start_ip}', {start_port + i}, 0, 0,now(), now(), now(), 1, 0, 'group_purchase'),")
+15
View File
@@ -0,0 +1,15 @@
from proxy_line.write_file import writ_json_file
if __name__ == '__main__':
root_path= "/Users/leonbob/workspace/project/langtu/lt/jsq/server-setting/new"
# 文件起始序号
sart_index_num = 101
# 起始监听端口号
start_listen_port = 5655
# 目标ip
target_ip = "10.0.0.2"
file_total_count = 60
writ_json_file(root_path, target_ip, sart_index_num, start_listen_port, file_total_count)
+6
View File
@@ -0,0 +1,6 @@
if __name__ == '__main__':
start_index = 161
end_index = 180
for i in range(start_index, end_index + 1):
print(f"nohup ./forward -c {i}.json > {i}.log 2>&1 &")
+30
View File
@@ -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)
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
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 /root/server_tun/server --port {port} "
f"--subnet {subnet} "
f"--gateway {gateway} "
f"--use-ip {use_ip} "
f"> /root/server_tun/{port}.log 2>&1 &")
commands.append(cmd)
return commands
if __name__ == "__main__":
# 参数配置
START_PORT = 5715
START_IP = "45.86.235.163"
COUNT = 20
cmds = generate_commands(START_PORT, 65, START_IP, COUNT)
for c in cmds:
print(c)
+11
View File
@@ -0,0 +1,11 @@
if __name__ == '__main__':
start_index = 5555
end_index = 5734
start_ip_subfix = 3
for index,item in enumerate(range(start_index, end_index + 1)):
print('START TRANSACTION;')
print(f"UPDATE port_keys SET out_ip = '45.86.235.{start_ip_subfix + index}' WHERE `port` = {item};")
print('COMMIT;')
+15
View File
@@ -0,0 +1,15 @@
import json
def writ_json_file(root_folder_path,sart_index_num, file_total_count,target_ip,start_listen_port) :
for i,v in enumerate(range(sart_index_num, sart_index_num + file_total_count)):
# 定义一个json
port = str(start_listen_port + i)
target = target_ip + ":" + port
json_config = {
"server": target,
"port": ":"+ port,
}
print(json_config)
# 写对应文件
with open(f'{root_folder_path}/{v}.json', 'w', encoding='utf-8') as json_file:
json.dump(json_config, json_file, indent=4)