rsyncd
This commit is contained in:
parent
43581c52aa
commit
d4aa9fa825
|
|
@ -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
|
||||
|
|
@ -4,8 +4,9 @@
|
|||
<p class="bgw" onclick="pluginService('rsyncd');">服务</p>
|
||||
<p onclick="pluginInitD('rsyncd');">自启动</p>
|
||||
<p onclick="pluginConfig('rsyncd');">配置修改</p>
|
||||
<p onclick="rsyncdReceive();">接收配置</p>
|
||||
<p onclick="pluginLogs('rsyncd','','run_log');">日志</p>
|
||||
<p onclick="smbRead()">说明</p>
|
||||
<!-- <p onclick="rsRead()">说明</p> -->
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
|
||||
|
||||
function smbRead(){
|
||||
function rsRead(){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>mac上连接`cmd+k`</li>';
|
||||
readme += '<li>不产生.DS_Store文件: defaults write com.apple.desktopservices DSDontWriteNetworkStores true</li>';
|
||||
readme += '<li>windows上连接例子: \\192.168.1.194</li>';
|
||||
|
||||
readme += '<li></li>';
|
||||
readme += '</ul>';
|
||||
|
||||
$('.soft-man-con').html(readme);
|
||||
|
|
|
|||
Loading…
Reference in New Issue