端口随机

This commit is contained in:
midoks
2022-10-01 16:41:55 +08:00
parent 0fafeabcf0
commit 9e9f10b06f
+5
View File
@@ -3,7 +3,9 @@
import time
import sys
import random
import os
chdir = os.getcwd()
sys.path.append(chdir + '/class/core')
@@ -31,6 +33,9 @@ if os.path.exists("data/port.pl"):
mw_port = mw.readFile('data/port.pl')
mw_port.strip()
else:
import firewall_api
mw_port = str(random.randint(10000, 65530))
firewall_api.firewall_api().addAcceptPortArgs(mw_port, 'MW-Panel', 'port')
mw.writeFile('data/port.pl', mw_port)
bind = []