X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fdomain_shellcommands.pm;h=582e29217a7297af3ecf72410940069d4d77fe3d;hb=03eaa0e229c5f5fc68a178d20fb69733db709787;hp=0ba561711991a2100cfc28cd742b1606bc892ec8;hpb=5fc8c5edf574ab024d4646914b6432d458e2ffbd;p=freeside.git
diff --git a/FS/FS/part_export/domain_shellcommands.pm b/FS/FS/part_export/domain_shellcommands.pm
index 0ba561711..582e29217 100644
--- a/FS/FS/part_export/domain_shellcommands.pm
+++ b/FS/FS/part_export/domain_shellcommands.pm
@@ -26,7 +26,7 @@ tie my %options, 'Tie::IxHash',
'options' => \%options,
'notes' => <<'END'
Run remote commands via SSH, for domains. You will need to
-setup SSH for unattended operation.
+setup SSH for unattended operation.
Use these buttons for some useful presets:
-
@@ -70,6 +70,7 @@ sub _export_delete {
sub _export_command {
my ( $self, $action, $svc_domain) = (shift, shift, shift);
my $command = $self->option($action);
+ return '' if $command =~ /^\s*$/;
#set variable for the command
no strict 'vars';
@@ -111,19 +112,22 @@ sub _export_replace {
( $old_qdomain = $old_domain ) =~ s/\./:/g; #see dot-qmail(5): EXTENSION ADDRESSES
( $new_qdomain = $new_domain ) =~ s/\./:/g; #see dot-qmail(5): EXTENSION ADDRESSES
- if ( $old->catchall ) {
+ {
no strict 'refs';
- my $svc_acct = $old->catchall_svc_acct;
- ${"old_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
- } else {
- ${"old_$_"} = '' foreach qw(uid gid dir);
- }
- if ( $new->catchall ) {
- no strict 'refs';
- my $svc_acct = $new->catchall_svc_acct;
- ${"new_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
- } else {
- ${"new_$_"} = '' foreach qw(uid gid dir);
+
+ if ( $old->catchall ) {
+ my $svc_acct = $old->catchall_svc_acct;
+ ${"old_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
+ } else {
+ ${"old_$_"} = '' foreach qw(uid gid dir);
+ }
+ if ( $new->catchall ) {
+ my $svc_acct = $new->catchall_svc_acct;
+ ${"new_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
+ } else {
+ ${"new_$_"} = '' foreach qw(uid gid dir);
+ }
+
}
#done setting variables for the command