X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fdomain_shellcommands.pm;h=8e85d71e17d36ad8961081f1ab5fe38d9ff5024e;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hp=d8ae0c376620884675befaca68ef91a122514e28;hpb=dabdf357484badff95afcae50b08ec1c3bb58343;p=freeside.git
diff --git a/FS/FS/part_export/domain_shellcommands.pm b/FS/FS/part_export/domain_shellcommands.pm
index d8ae0c376..8e85d71e1 100644
--- a/FS/FS/part_export/domain_shellcommands.pm
+++ b/FS/FS/part_export/domain_shellcommands.pm
@@ -22,11 +22,11 @@ tie my %options, 'Tie::IxHash',
%info = (
'svc' => 'svc_domain',
- 'desc' => 'Run remote commands via SSH, for domains.',
+ 'desc' => 'Run remote commands via SSH, for domains (qmail, ISPMan).',
'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:
The following variables are available for interpolation (prefixed with new_
or old_
for replace operations):
@@ -43,8 +49,7 @@ The following variables are available for interpolation (prefixed with new
$uid
- of catchall account
$gid
- of catchall account
$dir
- home directory of catchall account
- - All other fields in
- svc_domain are also available.
+
- All other fields in svc_domain are also available.
END
);
@@ -64,6 +69,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';
@@ -105,19 +111,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