From 9e9f10b06f49160213a8923c1faea54f93c778b3 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 1 Oct 2022 16:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E9=9A=8F=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setting.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setting.py b/setting.py index c60fd7c9e..2024c13b2 100755 --- a/setting.py +++ b/setting.py @@ -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 = []