projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix dates on aradial usage import, RT#29053
[freeside.git]
/
bin
/
aradial-sftp_and_import
diff --git
a/bin/aradial-sftp_and_import
b/bin/aradial-sftp_and_import
index
b0878e2
..
5335703
100755
(executable)
--- a/
bin/aradial-sftp_and_import
+++ b/
bin/aradial-sftp_and_import
@@
-65,7
+65,7
@@
our %status_type = (
###
use vars qw( $opt_m $opt_a $opt_b $opt_r $opt_d $opt_v $opt_P );
###
use vars qw( $opt_m $opt_a $opt_b $opt_r $opt_d $opt_v $opt_P );
-getopts('m:abr:dP:v:');
+getopts('m:abr:d
:
P:v:');
my %options = ();
my %options = ();
@@
-127,6
+127,8
@@
else {
foreach my $filename ( @$ls ) {
foreach my $filename ( @$ls ) {
+ next if $opt_d && $filename eq $opt_d;
+
warn "Downloading $filename\n" if $opt_v;
#get the file
warn "Downloading $filename\n" if $opt_v;
#get the file
@@
-167,6
+169,7
@@
foreach my $filename ( @$ls ) {
my @extra_values = ();
if ( $hash{'Status-Type'} eq 'Start' ) {
my @extra_values = ();
if ( $hash{'Status-Type'} eq 'Start' ) {
+ push @keys, 'AcctStartTime';
$dbhash{'AcctStartTime'} = $hash{'Date'};
$sql = 'INSERT INTO radacct ( '. join(',', @keys).
$dbhash{'AcctStartTime'} = $hash{'Date'};
$sql = 'INSERT INTO radacct ( '. join(',', @keys).
@@
-175,6
+178,8
@@
foreach my $filename ( @$ls ) {
} elsif ( $hash{'Status-Type'} eq 'Stop' ) {
my $AcctSessionId = delete($dbhash{AcctSessionId});
} elsif ( $hash{'Status-Type'} eq 'Stop' ) {
my $AcctSessionId = delete($dbhash{AcctSessionId});
+
+ push @keys, 'AcctStopTime';
$dbhash{'AcctStopTime'} = $hash{'Date'};
push @extra_values, $AcctSessionId;
$dbhash{'AcctStopTime'} = $hash{'Date'};
push @extra_values, $AcctSessionId;