X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fapache.export;h=b39b5f1a2ae5f71eb9e903f28ac66c3219b176e3;hb=8a507f43bfa5c5232b5babfbbf82ac5de5702add;hp=6142c92b461b9bd5e624ced5d123cf5687cd8ff1;hpb=9aec22e5fd00800c6e7952ae5b85cc639d4b1e78;p=freeside.git diff --git a/bin/apache.export b/bin/apache.export index 6142c92b4..b39b5f1a2 100755 --- a/bin/apache.export +++ b/bin/apache.export @@ -36,14 +36,17 @@ foreach my $export ( @exports ) { my @svc_www = $export->svc_x; foreach my $svc_www ( @svc_www ) { - use vars qw($zone $username); + use vars qw($zone $username $dir $email $config); $zone = $svc_www->domain_record->zone; $username = $svc_www->svc_acct->username; - print HTTPD_CONF eval(qq("$template")); + $dir = $svc_www->svc_acct->dir; + $email = $svc_www->svc_acct->email; + $config = $svc_www->config; + print HTTPD_CONF eval(qq("$template")). "\n\n"; } my $user = $export->option('user'); - my $httpd_conf = $export->option('httpd_conf') + my $httpd_conf = $export->option('httpd_conf'); $rsync->exec( { src => $file, @@ -51,15 +54,17 @@ foreach my $export ( @exports ) { } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); # warn $rsync->out; - ssh("root\@$machine", 'ndc reload'); + my $restart = $export->option('restart') || 'apachectl graceful'; + + ssh("root\@$machine", $restart); } -close NAMED_CONF; +close HTTPD_CONF; # ----- sub usage { - die "Usage:\n export.export user\n"; + die "Usage:\n apache.export user\n"; }