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=36da93a88fb4385184fd7beed0d750d8401198e2;hb=1dcea2453d573341d3153fb966b19be161c4f1ba;hpb=8ed2714fc50607081d7ac4edf0b17e23902dabba diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index 36da93a88..6847f6470 100644 --- a/FS/FS/part_export/www_shellcommands.pm +++ b/FS/FS/part_export/www_shellcommands.pm @@ -39,8 +39,8 @@ Run remote commands via SSH, for virtual web sites. You will need to
new_
or old_
for replace operations):
$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
@@ -83,6 +84,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 $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 ?
@@ -108,22 +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 ?
+ my $old_zone = $old_domain_record->zone; # or die ?
my $old_domain = $old_domain_record->svc_domain->domain;
- $old_zone .= ".$old_domain" unless $old_zone =~ /\.$/;
-
+ ( 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 ?
+ my $new_zone = $new_domain_record->zone; # 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;
- }
-
+ ( 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 ?