1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-02-12 18:41:52 +00:00

Really fix remove v2ray forward rules

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-07-08 22:14:28 +02:00
parent 8009729b30
commit 0f5ba7f272

View file

@ -597,6 +597,9 @@ def v2ray_del_port(user, port, proto, name):
for inbounds in data['inbounds']:
if inbounds['tag'] == tag:
data['inbounds'].remove(inbounds)
for routing in data['routing']['rules']:
if routing['inboundTag'][0] == tag:
data['routing']['rules'].remove(routing)
with open('/etc/v2ray/v2ray-server.json', 'w') as f:
json.dump(data, f, indent=4)
final_md5 = hashlib.md5(file_as_bytes(open('/etc/v2ray/v2ray-server.json', 'rb'))).hexdigest()