diff --git a/plugins/acme_pandominassl_apply/index.py b/plugins/acme_pandominassl_apply/index.py index cd21cf2a8..ce92ed492 100755 --- a/plugins/acme_pandominassl_apply/index.py +++ b/plugins/acme_pandominassl_apply/index.py @@ -563,7 +563,7 @@ def runHookPy(domain,path): # print(domain,path) run_log = runLog() hook_file = getConf() - cmd = 'cd '+mw.getRunDir() + cmd = 'cd '+mw.getPanelDir() cmd += ' && python3 '+hook_file + ' ' + domain + ' ' + path cmd += ' >> '+ run_log print(cmd) @@ -644,7 +644,7 @@ def getHookIdCmd(): if not data[0]: return data[1] - cmd = "cd "+mw.getRunDir()+" " + cmd = "cd "+mw.getPanelDir()+" " cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_hook_id 1.0 {"id":"'+args['id']+'"}' return mw.returnJson(True, 'ok',cmd) @@ -661,7 +661,7 @@ def runHookId(): return 'run hook '+args['id']+' end' def runHookCmd(): - cmd = "cd "+mw.getRunDir()+" " + cmd = "cd "+mw.getPanelDir()+" " cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_hook' return mw.returnJson(True, 'ok',cmd) @@ -738,7 +738,7 @@ def runSyncCfData(): return '' def runSyncCfCmd(): - cmd = "cd "+mw.getRunDir()+" " + cmd = "cd "+mw.getPanelDir()+" " cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_sync_cf_data' return mw.returnJson(True, 'ok',cmd) @@ -791,7 +791,7 @@ def runSyncDnsPodData(): return '' def runSyncDnsPodCmd(): - cmd = "cd "+mw.getRunDir()+" " + cmd = "cd "+mw.getPanelDir()+" " cmd += '&& python3 plugins/acme_pandominassl_apply/index.py run_sync_dnspod_data' return mw.returnJson(True, 'ok',cmd) diff --git a/plugins/acme_pandominassl_apply/tool_cron.py b/plugins/acme_pandominassl_apply/tool_cron.py index 5e16865d3..5672065fc 100644 --- a/plugins/acme_pandominassl_apply/tool_cron.py +++ b/plugins/acme_pandominassl_apply/tool_cron.py @@ -72,7 +72,7 @@ def createBgTaskByName(name): import crontab_api api = crontab_api.crontab_api() - mw_dir = mw.getRunDir() + mw_dir = mw.getPanelDir() cmd = ''' mw_dir=%s rname=%s diff --git a/plugins/backup_ftp/index.py b/plugins/backup_ftp/index.py index 1f1403890..dfaa7fe6a 100755 --- a/plugins/backup_ftp/index.py +++ b/plugins/backup_ftp/index.py @@ -188,7 +188,7 @@ def findPathName(path, filename): return l def backupAllFunc(stype): - os.chdir(mw.getRunDir()) + os.chdir(mw.getPanelDir()) name = sys.argv[2] num = sys.argv[3] @@ -230,11 +230,11 @@ def backupAllFunc(stype): 'type=? and pid=?', ('1', pid)).field('id,filename').select() args = stype + " " + name + " " + num - cmd = 'python3 ' + mw.getRunDir() + '/scripts/backup.py ' + args + cmd = 'python3 ' + mw.getPanelDir() + '/scripts/backup.py ' + args if stype.find('database_') > -1: plugin_name = stype.replace('database_', '') args = "database " + name + " " + num - cmd = 'python3 ' + mw.getRunDir() + '/plugins/' + plugin_name + \ + cmd = 'python3 ' + mw.getPanelDir() + '/plugins/' + plugin_name + \ '/scripts/backup.py ' + args os.system(cmd) diff --git a/plugins/gdrive/index.py b/plugins/gdrive/index.py index bf940d4c6..5a1d16103 100644 --- a/plugins/gdrive/index.py +++ b/plugins/gdrive/index.py @@ -203,9 +203,9 @@ def backupAllFunc(stype): mw.echoInfo("未授权API,无法使用!!!") return '' - os.chdir(mw.getRunDir()) + os.chdir(mw.getPanelDir()) backup_dir = mw.getBackupDir() - run_dir = mw.getRunDir() + run_dir = mw.getPanelDir() stype = sys.argv[1] name = sys.argv[2] diff --git a/plugins/mariadb/index.py b/plugins/mariadb/index.py index 01f895af1..4fd9ed3b5 100755 --- a/plugins/mariadb/index.py +++ b/plugins/mariadb/index.py @@ -2478,7 +2478,7 @@ def trySlaveSyncBugfix(version=''): return mw.returnJson(True, '修复成功!') def getSlaveSyncCmd(version=''): - root = mw.getRunDir() + root = mw.getPanelDir() cmd = 'cd ' + root + ' && python3 ' + root + \ '/plugins/mariadb/index.py do_full_sync {"db":"all","sign":""}' return mw.returnJson(True, 'ok', cmd) @@ -3027,7 +3027,7 @@ def fullSync(version=''): status_file = asyncTmpfile() if args['begin'] == '1': - cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + \ + cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + \ getPluginDir() + \ '/index.py do_full_sync {"db":"' + args['db'] + '","sign":"' + sign + '"} &' # print(cmd) diff --git a/plugins/migration_api/index.py b/plugins/migration_api/index.py index 25ad7fbac..f41493634 100755 --- a/plugins/migration_api/index.py +++ b/plugins/migration_api/index.py @@ -384,7 +384,7 @@ class classApi: zip_file = backup_path + \ "/psync_tmp_{}.tar.gz".format(os.path.basename(spath)) - zip_dst = mw.getRunDir() + '/tmp/psync_tmp_{}.tar.gz'.format( + zip_dst = mw.getPanelDir() + '/tmp/psync_tmp_{}.tar.gz'.format( os.path.basename(dpath)) write_log("|-正在压缩目录[{}]...".format(spath)) self.write_speed('done', '正在压缩') diff --git a/plugins/msonedrive/index.py b/plugins/msonedrive/index.py index 6a34658ed..71abaeb68 100644 --- a/plugins/msonedrive/index.py +++ b/plugins/msonedrive/index.py @@ -217,9 +217,9 @@ def backupAllFunc(stype): mw.echoInfo("未授权API,无法使用!!!") return '' - os.chdir(mw.getRunDir()) + os.chdir(mw.getPanelDir()) backup_dir = mw.getBackupDir() - run_dir = mw.getRunDir() + run_dir = mw.getPanelDir() stype = sys.argv[1] name = sys.argv[2] diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index 73a46e8a5..4c79ed0ba 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -831,7 +831,7 @@ def setDbBackup(): if not data[0]: return data[1] - scDir = getPluginDir() + '/scripts/backup.py' + scDir = getPanelDir() + '/scripts/backup.py' cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3' os.system(cmd) return mw.returnJson(True, 'ok') @@ -2569,7 +2569,7 @@ def trySlaveSyncBugfix(version=''): def getSlaveSyncCmd(version=''): - root = mw.getRunDir() + root = mw.getPanelDir() cmd = 'cd ' + root + ' && python3 ' + root + \ '/plugins/mysql/index.py do_full_sync {"db":"all","sign":""}' return mw.returnJson(True, 'ok', cmd) @@ -3450,7 +3450,7 @@ def fullSync(version=''): status_file = asyncTmpfile() if args['begin'] == '1': - cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \ + cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \ '/index.py do_full_sync {"db":"' + \ args['db'] + '","sign":"' + sign + '"} &' # print(cmd) diff --git a/plugins/mysql-yum/index.py b/plugins/mysql-yum/index.py index 7c85d1afb..d9b450128 100755 --- a/plugins/mysql-yum/index.py +++ b/plugins/mysql-yum/index.py @@ -830,7 +830,7 @@ def setDbBackup(): if not data[0]: return data[1] - scDir = getPluginDir() + '/scripts/backup.py' + scDir = getPanelDir() + '/scripts/backup.py' cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3' os.system(cmd) return mw.returnJson(True, 'ok') @@ -2551,7 +2551,7 @@ def trySlaveSyncBugfix(version=''): def getSlaveSyncCmd(version=''): - root = mw.getRunDir() + root = mw.getPanelDir() cmd = 'cd ' + root + ' && python3 ' + root + \ '/plugins/mysql/index.py do_full_sync {"db":"all"}' return mw.returnJson(True, 'ok', cmd) @@ -3433,7 +3433,7 @@ def fullSync(version=''): status_file = asyncTmpfile() if args['begin'] == '1': - cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \ + cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \ '/index.py do_full_sync {"db":"' + \ args['db'] + '","sign":"' + sign + '"} &' # print(cmd) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index b53a42ecc..3b501cf7a 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -973,7 +973,7 @@ def setDbBackup(): if not data[0]: return data[1] - scDir = mw.getRunDir() + '/scripts/backup.py' + scDir = mw.getPanelDir() + '/scripts/backup.py' cmd = 'python3 ' + scDir + ' database ' + args['name'] + ' 3' os.system(cmd) return mw.returnJson(True, 'ok') @@ -2780,7 +2780,7 @@ def trySlaveSyncBugfix(version=''): def getSlaveSyncCmd(version=''): - root = mw.getRunDir() + root = mw.getPanelDir() cmd = 'cd ' + root + ' && python3 ' + root + \ '/plugins/mysql/index.py do_full_sync {"db":"all","sign",""}' return mw.returnJson(True, 'ok', cmd) @@ -3728,7 +3728,7 @@ def fullSync(version=''): status_file = asyncTmpfile() if args['begin'] == '1': - cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + getPluginDir() + \ + cmd = 'cd ' + mw.getPanelDir() + ' && python3 ' + getPluginDir() + \ '/index.py do_full_sync {"db":"' + \ args['db'] + '","sign":"' + sign + '"} &' # print(cmd) diff --git a/plugins/op_waf/tool_task.py b/plugins/op_waf/tool_task.py index 88416b9ef..70d2fd107 100644 --- a/plugins/op_waf/tool_task.py +++ b/plugins/op_waf/tool_task.py @@ -93,7 +93,7 @@ def createBgTaskByName(name, args): _where1 = args['minute-n'] _minute = '' - mw_dir = mw.getRunDir() + mw_dir = mw.getPanelDir() cmd = ''' mw_dir=%s rname=%s