X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Ftextradius.pm;h=1492f267296a60ecc96fa188469c51c53671613d;hp=691753f25550ce0ef7f6db548b98fed36aa54fb5;hb=d5ae9f38bdea9e3de50f76aa8caf06956b4fb706;hpb=6f8f8741b105fdc1fc005536e6ee0acbd5783793 diff --git a/FS/FS/part_export/textradius.pm b/FS/FS/part_export/textradius.pm index 691753f25..1492f2672 100644 --- a/FS/FS/part_export/textradius.pm +++ b/FS/FS/part_export/textradius.pm @@ -43,7 +43,7 @@ sub textradius_queue { 'job' => "FS::part_export::textradius::textradius_$method", }; $queue->insert( - $self->option('user'), + $self->option('user')||'root', $self->machine, $self->option('users'), @_, @@ -55,7 +55,7 @@ sub textradius_insert { #subroutine, not method #silly arg processing my($att, @check); - push @check, $att while ($att=shift @attributes) ne '-'; + push @check, $att while @attributes && ($att=shift @attributes) ne '-'; my %check = @check; my %reply = @attributes; @@ -126,7 +126,13 @@ sub textradius_download { $rsync->exec( { src => "$user\@$host:$users", dest => $dest, - } ); + } ); # true/false return value from exec is not working, alas + if ( $rsync->err ) { + die "error downloading $user\@$host:$users : ". + 'exit status: '. $rsync->status. ', '. + 'STDERR: '. join(" / ", $rsync->err). ', '. + 'STDOUT: '. join(" / ", $rsync->out); + } $dest; } @@ -145,7 +151,13 @@ sub textradius_upload { $rsync->exec( { src => "$dir/users", dest => "$user\@$host:$users", - } ); + } ); # true/false return value from exec is not working, alas + if ( $rsync->err ) { + die "error uploading to $user\@$host:$users : ". + 'exit status: '. $rsync->status. ', '. + 'STDERR: '. join(" / ", $rsync->err). ', '. + 'STDOUT: '. join(" / ", $rsync->out); + } flock(LOCK,LOCK_UN); close LOCK;