diff --git a/plugins/pureftp/index.py b/plugins/pureftp/index.py index c8ee11b2c..1526db36e 100755 --- a/plugins/pureftp/index.py +++ b/plugins/pureftp/index.py @@ -90,6 +90,14 @@ def initDreplace(): public.writeFile(file_bin, content) public.execShell('chmod +x ' + file_bin) + pureTplConfig = getPluginDir() + "/init.d/pure-config.pl" + pureSbinConfig = getServerDir() + "/sbin/pure-config.pl" + + content = public.readFile(pureTplConfig) + content = contentReplace(content) + public.writeFile(pureSbinConfig, content) + public.execShell('chmod +x ' + pureSbinConfig) + # # config replace # conf_content = public.readFile(getConf()) # conf_content = conf_content.replace('{$SERVER_PATH}', service_path) @@ -103,7 +111,7 @@ def start(): data = public.execShell(file + ' start') if data[1] == '': return 'ok' - return 'fail' + return data[1] def stop(): @@ -111,7 +119,7 @@ def stop(): data = public.execShell(file + ' stop') if data[1] == '': return 'ok' - return 'fail' + return data[1] def restart(): @@ -127,7 +135,7 @@ def reload(): data = public.execShell(file + ' reload') if data[1] == '': return 'ok' - return 'fail' + return data[1] def initdStatus(): diff --git a/plugins/pureftp/info.json b/plugins/pureftp/info.json index d259182a2..27dc9ba06 100755 --- a/plugins/pureftp/info.json +++ b/plugins/pureftp/info.json @@ -1,5 +1,5 @@ { - "title":"pureftp", + "title":"PureFtpd", "tip":"soft", "name":"pureftp", "ps":"PureFTPd是一款专注于程序健壮和软件安全的免费FTP服务器软件", diff --git a/plugins/pureftp/init.d/pure-config.pl b/plugins/pureftp/init.d/pure-config.pl index 146b3dcc2..bf6e98278 100644 --- a/plugins/pureftp/init.d/pure-config.pl +++ b/plugins/pureftp/init.d/pure-config.pl @@ -9,7 +9,7 @@ my ($conffile, @flg) = @ARGV; my $PUREFTPD; -x && ($PUREFTPD=$_, last) for qw( - ${exec_prefix}/sbin/pure-ftpd + {$SERVER_PATH}/pureftp/sbin/pure-ftpd /www/server/pure-ftpd/sbin/pure-ftpd /www/server/pureftpd/sbin/pure-ftpd /www/server/sbin/pure-ftpd diff --git a/plugins/pureftp/init.d/pure-ftpd.tpl b/plugins/pureftp/init.d/pure-ftpd.tpl index e7e5c7dca..f30ba88f1 100644 --- a/plugins/pureftp/init.d/pure-ftpd.tpl +++ b/plugins/pureftp/init.d/pure-ftpd.tpl @@ -15,7 +15,7 @@ ### END INIT INFO # Pure-FTPd Settings -PURE_PERL="{$SERVER_PATH}/pureftp/sbin/pure-ftpd" +PURE_PERL="{$SERVER_PATH}/pureftp/sbin/pure-config.pl" PURE_CONF="{$SERVER_PATH}/pureftp/etc/pure-ftpd.conf" PURE_PID="/var/run/pure-ftpd.pid" RETVAL=0