summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xftp_wizard/Proftpd.pm15
1 files changed, 6 insertions, 9 deletions
diff --git a/ftp_wizard/Proftpd.pm b/ftp_wizard/Proftpd.pm
index 6c970323..ebc7e266 100755
--- a/ftp_wizard/Proftpd.pm
+++ b/ftp_wizard/Proftpd.pm
@@ -250,21 +250,18 @@ sub do_it {
my $file = "/etc/proftpd.conf";
die "no ftp configuration file found ! warning." if !-f $file;
MDK::Common::cp_af($file, $file . ".orig");
- my $allow = "all";
+ my $allow;
if ($wiz_ftp_internal && !$wiz_ftp_external) {
($allow) = $wiz->{net}->itf_get("IPADDR") =~ qr/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}$/;
$allow .= " 127.0.0.1";
}
- elsif (!$wiz_ftp_external) {
- $allow = "none";
+ elsif ($wiz_ftp_external) {
+ $allow = "all";
}
my $conf = cat_($file) . "#EndOfFile";
my ($bloc) = $conf =~ /.*?(#drakwizard_pxe_b.*?#drakwizard_pxe_end)\n.*#EndOfFile/s;
- # print "$begin\n";
- # print "$end\n";
-
if (!$bloc) {
$bloc = "
#drakwizard_pxe_b
@@ -279,9 +276,9 @@ sub do_it {
";
append_to_file($file, $bloc);
- } else {
- substInFile { s/Allow from.*/Allow from $allow/ }
- }
+ } else {
+ substInFile { s/Allow from.*/Allow from $allow/ } $file;
+ }
# options
# wiz_root_login wiz_server_admin wiz_default_root wiz_ftp_resume wiz_ftp_fxp