From b282fa9c4eade58c0e7d01047ab77ca5b138487c Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 20 Jun 2022 10:49:15 +0800 Subject: [PATCH] rsyncd --- plugins/rsyncd/index.py | 20 ++++++++++---------- plugins/rsyncd/init.d/rsyncd.service.tpl | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index 120e1f739..e3f8814e3 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -77,15 +77,14 @@ def status(): def appConf(): - if mw.isAppleSystem(): - return getServerDir() + '/rsyncd.conf' - return '/etc/rsyncd.conf' + return getServerDir() + '/rsyncd.conf' + # return '/etc/rsyncd.conf' def appConfPwd(): - if mw.isAppleSystem(): - return getServerDir() + '/rsyncd.passwd' - return '/etc/rsyncd.passwd' + # if mw.isAppleSystem(): + return getServerDir() + '/rsyncd.passwd' + # return '/etc/rsyncd.passwd' def getLog(): @@ -99,15 +98,16 @@ def getLog(): def initDreplace(): - conf_path = appConf() - conf = mw.readFile(conf_path) - compile_sub = re.compile('^#(.*)', re.M) - conf = compile_sub.sub('', conf) + # conf + conf_path = appConf() conf_tpl_path = getPluginDir() + '/conf/rsyncd.conf' if conf.strip() == '': + of not os.path.exists(conf_path): content = mw.readFile(conf_tpl_path) mw.writeFile(conf_path, content) + + # pwd confpwd_path = appConfPwd() if not os.path.exists(confpwd_path): mw.writeFile(confpwd_path, '') diff --git a/plugins/rsyncd/init.d/rsyncd.service.tpl b/plugins/rsyncd/init.d/rsyncd.service.tpl index 66e68ea3f..72dd0efc9 100644 --- a/plugins/rsyncd/init.d/rsyncd.service.tpl +++ b/plugins/rsyncd/init.d/rsyncd.service.tpl @@ -3,7 +3,7 @@ Description=fast remote file copy program daemon ConditionPathExists={$SERVER_PATH}/rsyncd/rsyncd.conf [Service] -ExecStart={$RSYNC_BIN} --daemon --no-detach +ExecStart={$RSYNC_BIN} --config={$SERVER_PATH}/rsyncd/rsyncd.conf --daemon --no-detach [Install] WantedBy=multi-user.target