X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fwww_shellcommands.pm;h=6847f64709d429446706b08d71949ab556cd64e1;hp=cc1983bf2c7fd66294ded7c3842102e18565e3a8;hb=1dcea2453d573341d3153fb966b19be161c4f1ba;hpb=dabdf357484badff95afcae50b08ec1c3bb58343
diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm
index cc1983bf2..6847f6470 100644
--- a/FS/FS/part_export/www_shellcommands.pm
+++ b/FS/FS/part_export/www_shellcommands.pm
@@ -27,10 +27,29 @@ 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
+ $bare_zone
- just the zone of this virtual host, without the domain portion
+ $domain
- base domain
$username
$homedir
- All other fields in svc_www
@@ -64,6 +83,8 @@ 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 $bare_zone = $zone ) =~ s/\.$domain$//;
my $svc_acct = $svc_www->svc_acct; # or die ?
my $username = $svc_acct->username;
my $homedir = $svc_acct->dir; # or die ?
@@ -89,23 +110,17 @@ sub _export_replace {
${"new_$_"} = $new->getfield($_) foreach $new->fields;
}
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_zone = $old_domain_record->zone; # or die ?
+ my $old_domain = $old_domain_record->svc_domain->domain;
+ ( my $old_bare_zone = $old_zone ) =~ s/\.$old_domain$//;
my $old_svc_acct = $old->svc_acct; # or die ?
my $old_username = $old_svc_acct->username;
my $old_homedir = $old_svc_acct->dir; # or die ?
my $new_domain_record = $new->domain_record; # or die ?
- my $new_zone = $new_domain_record->reczone; # or die ?
- unless ( $new_zone =~ /\.$/ ) {
- my $new_svc_domain = $new_domain_record->svc_domain; # or die ?
- $new_zone .= '.'. $new_svc_domain->domain;
- }
-
+ my $new_zone = $new_domain_record->zone; # or die ?
+ my $new_domain = $new_domain_record->svc_domain->domain;
+ ( my $new_bare_zone = $new_zone ) =~ s/\.$new_domain$//;
my $new_svc_acct = $new->svc_acct; # or die ?
my $new_username = $new_svc_acct->username;
my $new_homedir = $new_svc_acct->dir; # or die ?