diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index a35c14a6a..a2c48cbae 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -387,9 +387,16 @@ def addRec(): args_ps = args['ps'] if not mw.isAppleSystem(): - os.system("mkdir -p " + args_path + " &") - os.system("chown -R www:www " + args_path + " &") - os.system("chmod -R 755 " + args_path + " &") + if os.path.exists(args_path): + import utils.file as utils_file + info = utils_file.getAccess(args_path) + file_chown = info['chown'] + if file_chown != 'www': + return mw.returnJson(False, '建议手动执行命令: chown -R www:www '+ args_path) + else: + os.system("mkdir -p " + args_path + " &") + os.system("chown -R www:www " + args_path + " &") + os.system("chmod -R 755 " + args_path + " &") delRecBy(args_name) diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index bbfc1115d..f7e2a7f23 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -667,9 +667,13 @@ function addReceive(name = ""){ var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); rsPost('add_rec', args, function(data){ var rdata = $.parseJSON(data.data); - layer.close(loadOpen); - layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); - setTimeout(function(){rsyncdReceive();},2000); + if (rdata['status']){ + layer.close(loadOpen); + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']}); + setTimeout(function(){rsyncdReceive();},2000); + } else { + layer.msg(rdata.msg,{icon:rdata.status?1:2,time:10000,shade: [0.3, '#000']}); + } }); } });