diff --git a/plugins/rsyncd/conf/rsyncd.conf b/plugins/rsyncd/conf/rsyncd.conf new file mode 100644 index 000000000..e8c386149 --- /dev/null +++ b/plugins/rsyncd/conf/rsyncd.conf @@ -0,0 +1,7 @@ +uid = www +gid = www +use chroot = no +max connections = 100 +log file = /var/log/rsyncd.log +pid file = /var/run/rsyncd.pid +list = false \ No newline at end of file diff --git a/plugins/rsyncd/index.html b/plugins/rsyncd/index.html index 1bd8e9476..413109223 100755 --- a/plugins/rsyncd/index.html +++ b/plugins/rsyncd/index.html @@ -4,8 +4,9 @@

服务

自启动

配置修改

+

接收配置

日志

-

说明

+
diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index 77b970509..84cd13b48 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -65,7 +65,36 @@ def status(): return 'start' +def appConf(): + if public.isAppleSystem(): + return getServerDir() + '/rsyncd.conf' + return '/etc/rsyncd.conf' + + +def getLog(): + conf_path = appConf() + conf = public.readFile(conf_path) + rep = 'log file\s*=\s*(.*)' + tmp = re.search(rep, conf) + if not tmp: + return '' + return tmp.groups()[0] + + +def initConf(): + import re + conf_path = appConf() + conf = public.readFile(conf_path) + conf = re.sub('#*(.*)', '', conf) + conf_tpl_path = getPluginDir() + '/conf/rsyncd.conf' + if conf.strip() == '': + content = public.readFile(conf_tpl_path) + public.writeFile(conf_path, content) + + def start(): + initConf() + if public.isAppleSystem(): return "Apple Computer does not support" @@ -132,9 +161,7 @@ def initdUinstall(): return 'ok' -def appConf(): - return '/etc/rsyncd.conf' - +# rsyncdReceive if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -155,5 +182,7 @@ if __name__ == "__main__": print initdUinstall() elif func == 'conf': print appConf() + elif func == 'run_log': + print getLog() else: print 'error' diff --git a/plugins/rsyncd/js/rsyncd.js b/plugins/rsyncd/js/rsyncd.js index fda380f8e..e8e9b34e5 100755 --- a/plugins/rsyncd/js/rsyncd.js +++ b/plugins/rsyncd/js/rsyncd.js @@ -1,11 +1,8 @@ -function smbRead(){ +function rsRead(){ var readme = ''; $('.soft-man-con').html(readme);