Skip to content

Commit

Permalink
wresetup cleanup, remove unused files, simplify the config passing, s…
Browse files Browse the repository at this point in the history
…etup the demo nginx file.
  • Loading branch information
perlDreamer committed Jan 6, 2012
1 parent eb3e5a4 commit 6ab2469
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions wre/sbin/wresetup.pl
Expand Up @@ -12,16 +12,9 @@

use strict;
use lib '/data/wre/lib';
use Carp qw(carp croak);
use WRE::Config;
use WRE::File;

use WRE::Host;
use WRE::Starman;
use WRE::Nginx;
use WRE::Mysql;
use WRE::Site;
use WRE::Spectre;
use Getopt::Long ();
use Pod::Usage ();

Expand All @@ -37,14 +30,11 @@
# server daemon
my $wreConfig = WRE::Config->new;
my $host = WRE::Host->new(wreConfig => $wreConfig);
my $file = WRE::File->new(wreConfig => $wreConfig);

my $file = WRE::File->new(wreConfig=>$config);

if ($config->get("demo/enabled") == 0 && $cgi->param("enableDemo") == 1) {
$file->makePath($config->getDomainRoot("/demo"));
$file->copy($config->getRoot("/var/setupfiles/demo.nginx"), $config->getRoot("/etc/demo.nginx"),
{ force => 1, templateVars=>{ sitename=>$config->get("demo/hostname") } });
}
$file->makePath($config->getDomainRoot("/demo"));
$file->copy($config->getRoot("/var/setupfiles/demo.nginx"), $config->getRoot("/etc/demo.nginx"),
{ force => 1, templateVars=>{ sitename=>$config->get("demo/hostname") } });
$file->copy($config->getRoot("/var/setupfiles/nginx.conf"),
$config->getRoot("/etc/nginx.conf"),
{ force => 1, templateVars=>{osName=>$host->getOsName} });
Expand Down Expand Up @@ -78,10 +68,6 @@ =head1 DESCRIPTION
=over
=item B<--configFile>
The full path to a WRE configuration file.
=item B<--help>
Shows this documentation and then exits.
Expand Down

0 comments on commit 6ab2469

Please sign in to comment.