quick hack to add extra 'config lines' to svc_www and otherwise enhance svc_www
[freeside.git] / bin / apache.export
index f0a6bee..b39b5f1 100755 (executable)
@@ -36,9 +36,12 @@ 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;
+    $dir = $svc_www->svc_acct->dir;
+    $email = $svc_www->svc_acct->email;
+    $config = $svc_www->config;
     print HTTPD_CONF eval(qq("$template")). "\n\n";
   }
 
@@ -51,7 +54,9 @@ foreach my $export ( @exports ) {
   } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
  # warn $rsync->out;
 
-  ssh("root\@$machine", 'apachectl graceful');
+  my $restart = $export->option('restart') || 'apachectl graceful';
+
+  ssh("root\@$machine", $restart);
 
 }