From 816cd89dd17af3d825a1b92e9727a13b6bac1de1 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 7 Nov 2022 09:54:49 +0800 Subject: [PATCH] Update index.py --- plugins/mysql-apt/index.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 8eb0f8d16..0d19166f3 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -87,6 +87,22 @@ def getConf(): return path +def getDbPort(): + file = getConf() + content = mw.readFile(file) + rep = 'port\s*=\s*(.*)' + tmp = re.search(rep, content) + return tmp.groups()[0].strip() + + +def getSocketFile(): + file = getConf() + content = mw.readFile(file) + rep = 'socket\s*=\s*(.*)' + tmp = re.search(rep, content) + return tmp.groups()[0].strip() + + def contentReplace(content): service_path = mw.getServerDir() content = content.replace('{$ROOT_PATH}', mw.getRootDir())