pull/632/head
Mr Chen 5 months ago
parent 54f5b44e04
commit 58129d5209
  1. 16
      plugins/mtproxy/index.py
  2. 6
      plugins/rsyncd/index.py

@ -75,6 +75,22 @@ def getServiceFile():
return systemDir + '/mtproxy.service'
def __release_port(port):
from collections import namedtuple
try:
from utils.firewall import Firewall as MwFirewall
MwFirewall.instance().addAcceptPort(port, 'mtproxy', 'port')
return port
except Exception as e:
return "Release failed {}".format(e)
def openFtpPort():
for i in ["8349"]:
__release_port(i)
return True
def initDreplace():
envTpl = getConfEnvTpl()

@ -347,15 +347,15 @@ def getRecListData():
n = i + 1
reg = ''
if n == flist_len:
reg = '\\[' + flist[i] + '\\](.*)\\[?'
reg = r'\[' + flist[i] + r'\](.*)\[?'
else:
reg = '\\[' + flist[i] + '\\](.*)\\[' + flist[n] + '\\]'
reg = r'\[' + flist[i] + r'\](.*)\[' + flist[n] + r'\]'
t1 = re.search(reg, content, re.S)
if t1:
args = t1.groups()[0]
# print('args start', args, 'args_end')
t2 = re.findall('\\s*(.*)\\s*\\=\\s*?(.*)?', args, re.M | re.I)
t2 = re.findall(r'\s*(.*)\s*\=\s*?(.*)?', args, re.M | re.I)
for i in range(len(t2)):
tmp[t2[i][0].strip()] = t2[i][1].strip()
ret_list.append(tmp)

Loading…
Cancel
Save