diff --git a/class/core/common.py b/class/core/common.py index 5a4f8b5f5..d4db9d980 100755 --- a/class/core/common.py +++ b/class/core/common.py @@ -32,6 +32,7 @@ from flask import redirect def init(): + initSystemControl() initDB() initDBSshPort() initUserInfo() @@ -146,17 +147,20 @@ def initInitTask(): def initSystemControl(): + path = 'data/default.db' + if os.path.exists(path): + return False + import system_api sapi = system_api.system_api() - sapi.setControl(1, 30) + r = sapi.setControl(1, 30) + print(r) def initUserInfo(): data = mw.M('users').where('id=?', (1,)).getField('password') if data == '21232f297a57a5a743894a0e4a801fc3': - # 默认监控开启 - initSystemControl() pwd = mw.getRandomString(8).lower() file_pw = mw.getRunDir() + '/data/default.pl'