mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:29:26 +08:00
update
This commit is contained in:
@@ -1398,6 +1398,10 @@ def installPreInspection():
|
||||
return "请先安装OpenResty"
|
||||
return 'ok'
|
||||
|
||||
def uninstallPreInspection():
|
||||
stop()
|
||||
return 'ok'
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -1412,6 +1416,8 @@ if __name__ == "__main__":
|
||||
print(reload())
|
||||
elif func == 'install_pre_inspection':
|
||||
print(installPreInspection())
|
||||
elif func == 'uninstall_pre_inspection':
|
||||
print(uninstallPreInspection())
|
||||
elif func == 'run_info':
|
||||
print(runInfo())
|
||||
elif func == 'get_global_conf':
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
"name": "webstats",
|
||||
"title": "网站统计",
|
||||
"shell": "install.sh",
|
||||
"versions":["0.2.5"],
|
||||
"versions":"0.2.5",
|
||||
"tip": "soft",
|
||||
"install_pre_inspection":true,
|
||||
"checks": "server/webstats",
|
||||
"uninstall_pre_inspection":true,
|
||||
"checks": "server/webstats/version.pl",
|
||||
"path": "server/webstats",
|
||||
"display": 1,
|
||||
"author": "midoks",
|
||||
|
||||
@@ -130,12 +130,12 @@ Install_App()
|
||||
if [ -f $serverPath/source/webstats/GeoLite2-City.mmdb ];then
|
||||
cp -rf $serverPath/source/webstats/GeoLite2-City.mmdb $serverPath/webstats/GeoLite2-City.mmdb
|
||||
fi
|
||||
|
||||
echo "${VERSION}" > $serverPath/webstats/version.pl
|
||||
|
||||
cd $rootPath && python3 plugins/webstats/index.py start
|
||||
echo "${VERSION}" > $serverPath/webstats/version.pl
|
||||
|
||||
echo '网站统计安装完成'
|
||||
|
||||
|
||||
# delete install data
|
||||
if [ -d $serverPath/source/webstats/lsqlite3_fsl09y ];then
|
||||
rm -rf $serverPath/source/webstats/lsqlite3_fsl09y
|
||||
|
||||
@@ -93,7 +93,7 @@ def removeBgTask():
|
||||
"id=?", (cfg["task_id"],)).find()
|
||||
if res and res["id"] == cfg["task_id"]:
|
||||
data = MwCrontab.instance().delete(cfg["task_id"])
|
||||
if data[0]:
|
||||
if data['status']:
|
||||
# print(data[1])
|
||||
cfg["task_id"] = -1
|
||||
mw.writeFile(getTaskConf(), json.dumps(cfg))
|
||||
|
||||
+11
-6
@@ -481,11 +481,13 @@ class plugin(object):
|
||||
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
|
||||
|
||||
|
||||
|
||||
if coexist and pInfo['setup']:
|
||||
pInfo['setup_version'] = info['versions']
|
||||
else:
|
||||
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
|
||||
elif pInfo['setup']:
|
||||
if os.path.isdir(pInfo['install_checks']):
|
||||
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
|
||||
else:
|
||||
pInfo['setup_version'] = mw.readFile(pInfo['install_checks']).strip()
|
||||
|
||||
if 'install_pre_inspection' in info:
|
||||
pInfo['install_pre_inspection'] = info['install_pre_inspection']
|
||||
@@ -792,7 +794,7 @@ class plugin(object):
|
||||
if 'coexist' in info and info['coexist']:
|
||||
name = info['title'] + '-'+ version
|
||||
if name in data:
|
||||
del(data[name])
|
||||
del(data[name])
|
||||
thisdb.setOption(self.__plugin_status_cachekey, json.dumps(data))
|
||||
|
||||
# shell/bash方式调用
|
||||
@@ -801,6 +803,10 @@ class plugin(object):
|
||||
args = '',
|
||||
script = 'index',
|
||||
):
|
||||
|
||||
if mw.inArray(['start','stop','restart','reload','uninstall_pre_inspection','install','uninstall'], func):
|
||||
self.runByCache(name, func, version)
|
||||
|
||||
path = self.__plugin_dir + '/' + name + '/' + script + '.py'
|
||||
if not os.path.exists(path):
|
||||
path = self.__plugin_dir + '/' + name + '/' + name + '.py'
|
||||
@@ -816,8 +822,7 @@ class plugin(object):
|
||||
py_cmd = 'cd ' + mw.getPanelDir() + " && "+ py_cmd
|
||||
data = mw.execShell(py_cmd)
|
||||
|
||||
if mw.inArray(['start','stop','restart','reload'], func):
|
||||
self.runByCache(name, func, version)
|
||||
|
||||
|
||||
# print(data)
|
||||
if mw.isDebugMode():
|
||||
|
||||
Reference in New Issue
Block a user