X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fwww_shellcommands.pm;h=a272edab0d1a8c21ae9c8712fb28c25f8392ce15;hb=e53cf6b04ea8c6f10c331d46372c486128478df0;hp=cc1983bf2c7fd66294ded7c3842102e18565e3a8;hpb=dabdf357484badff95afcae50b08ec1c3bb58343;p=freeside.git
diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm
index cc1983bf2..a272edab0 100644
--- a/FS/FS/part_export/www_shellcommands.pm
+++ b/FS/FS/part_export/www_shellcommands.pm
@@ -27,10 +27,28 @@ tie my %options, 'Tie::IxHash',
'notes' => <<'END'
Run remote commands via SSH, for virtual web sites. You will need to
setup SSH for unattended operation.
-
The following variables are available for interpolation (prefixed with
+
Use these buttons for some useful presets:
+
+The following variables are available for interpolation (prefixed with
new_
or old_
for replace operations):
- $zone
+ $zone
- fully-qualified zone of this virtual host
+ $domain
- base domain
$username
$homedir
- All other fields in svc_www
@@ -64,6 +82,7 @@ sub _export_command {
}
my $domain_record = $svc_www->domain_record; # or die ?
my $zone = $domain_record->zone; # or die ?
+ my $domain = $domain_record->svc_domain->domain;
my $svc_acct = $svc_www->svc_acct; # or die ?
my $username = $svc_acct->username;
my $homedir = $svc_acct->dir; # or die ?
@@ -90,10 +109,8 @@ sub _export_replace {
}
my $old_domain_record = $old->domain_record; # or die ?
my $old_zone = $old_domain_record->reczone; # or die ?
- unless ( $old_zone =~ /\.$/ ) {
- my $old_svc_domain = $old_domain_record->svc_domain; # or die ?
- $old_zone .= '.'. $old_svc_domain->domain;
- }
+ my $old_domain = $old_domain_record->svc_domain->domain;
+ $old_zone .= ".$old_domain" unless $old_zone =~ /\.$/;
my $old_svc_acct = $old->svc_acct; # or die ?
my $old_username = $old_svc_acct->username;
@@ -101,6 +118,7 @@ sub _export_replace {
my $new_domain_record = $new->domain_record; # or die ?
my $new_zone = $new_domain_record->reczone; # or die ?
+ my $new_domain = $new_domain_record->svc_domain->domain;
unless ( $new_zone =~ /\.$/ ) {
my $new_svc_domain = $new_domain_record->svc_domain; # or die ?
$new_zone .= '.'. $new_svc_domain->domain;