quick hack to add extra 'config lines' to svc_www and otherwise enhance svc_www
[freeside.git] / bin / apache.export
index 6142c92..b39b5f1 100755 (executable)
@@ -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"; 
 }