Skip to content

Commit

Permalink
Fixed: Can't locate Servers/named/external_server.pm
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
nuxwin committed Sep 24, 2016
1 parent dd54a6f commit f3e6f8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG
Expand Up @@ -4,12 +4,15 @@
Git 1.3.x
------------------------------------------------------------------------------------------------------------------------

SERVERS
Fixed: Can't locate Servers/named/external_server.pm

------------------------------------------------------------------------------------------------------------------------
1.3.2
------------------------------------------------------------------------------------------------------------------------

2016-09-24: Laurent Declercq
RELEASE i-MSCP 1.3.2
RELEASE i-MSCP 1.3.2

BACKEND
Fixed: Allow detection of bind mounts (iMSCP::Mount)
Expand Down
11 changes: 7 additions & 4 deletions engine/PerlLib/Servers/named.pm
Expand Up @@ -51,16 +51,19 @@ sub factory
{
return $instance if defined $instance;

my $sName = $main::imscpConfig{'NAMED_SERVER'};
my $sName = $main::imscpConfig{'NAMED_SERVER'} || 'external_server';

if (defined $main::execmode && $main::execmode eq 'setup') {
if ($sName eq 'external_server' && $main::imscpOldConfig{'NAMED_SERVER'} ne '') {
my $package = "Servers::named::$main::imscpConfig{'NAMED_SERVER'}";
if ($sName eq 'external_server'
&& $main::imscpOldConfig{'NAMED_SERVER'} ne ''
&& $main::imscpOldConfig{'NAMED_SERVER'} ne $sName
) {
my $package = "Servers::named::$main::imscpOldConfig{'NAMED_SERVER'}";
eval "require $package";
fatal( $@ ) if $@;

my $rs = $package->getInstance()->uninstall();
fatal( sprintf( "Could not uninstall `%s' server", $main::imscpConfig{'NAMED_SERVER'} ) ) if $rs;
fatal( sprintf( "Could not uninstall the `%s' server", $main::imscpOldConfig{'NAMED_SERVER'} ) ) if $rs;
}
}

Expand Down

0 comments on commit f3e6f8b

Please sign in to comment.