diff options
Diffstat (limited to 'Xerl/Setup/Configure.pm')
| -rw-r--r-- | Xerl/Setup/Configure.pm | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Xerl/Setup/Configure.pm b/Xerl/Setup/Configure.pm index 537ac4f..8f19f80 100644 --- a/Xerl/Setup/Configure.pm +++ b/Xerl/Setup/Configure.pm @@ -1,6 +1,6 @@ -# Xerl (c) 2005-2011, 2013, 2014 by Paul Buetow +# Xerl (c) 2005-2011, 2013-2015 by Paul Buetow # -# E-Mail: xerl@dev.buetow.org WWW: http://xerl.buetow.org +# E-Mail: xerl@dev.buetow.org WWW: https://xerl.buetow.org # # This is free software, you may use it and distribute it under the same # terms as Perl itself. @@ -64,8 +64,9 @@ sub defaults { $self->set_hostname( lc $hostname ) unless $self->hostname_exists(); - unless ( -d $self->get_hostroot() . $self->get_host() ) { - my $redirect = $self->get_hostroot() . 'redirect:' . $self->get_host(); + my $host = $self->get_host(); + unless ( -d $self->get_hostroot() . $host ) { + my $redirect = $self->get_hostroot() . 'redirect:' . $host; if ( -f $redirect ) { my $file = Xerl::Tools::FileIO->new( 'path' => $redirect ); @@ -76,13 +77,22 @@ sub defaults { $self->set_finish_request(1); } - my $alias = $self->get_hostroot() . 'alias:' . $self->get_host(); + my $alias = $self->get_hostroot() . 'alias:' . $host; + my $alias_host = ''; + + unless ( -f $alias ) { + my ($hostname, @domain) = split /\./, $host; + my $domain = join '.', @domain; + $alias = $self->get_hostroot() . 'alias:' . $domain; + $alias_host = "$hostname."; + } if ( -f $alias ) { my $file = Xerl::Tools::FileIO->new( 'path' => $alias ); - $file->fslurp(); - $self->set_host( $file->shift() ); + $alias_host .= $file->shift(); + + $self->set_host( $alias_host ); } } |
