diff options
author | levinse <levinse> | 2011-06-22 18:22:06 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-06-22 18:22:06 +0000 |
commit | b3ad201d0965bb04fd034ce1d86f2cf28bd7e036 (patch) | |
tree | f25c93b40ad8aff35576d037cf71b5590d8d3820 | |
parent | 0ce78ac5742a565864bc346e410c6401bc5bc60f (diff) |
freeside-cdr-sftp_and_import: add an option to gunzip imported files, RT10991
-rwxr-xr-x | FS/bin/freeside-cdr-sftp_and_import | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/bin/freeside-cdr-sftp_and_import b/FS/bin/freeside-cdr-sftp_and_import index e09f7dc58..ab9d4a658 100755 --- a/FS/bin/freeside-cdr-sftp_and_import +++ b/FS/bin/freeside-cdr-sftp_and_import @@ -96,7 +96,13 @@ foreach my $filename ( @$ls ) { my $ungziped = $filename; my $ungziped =~ s/\.gz$//; - system("gunzip $cachedir/$filename") if $opt_g; + if ( $opt_g ) { + if(system('gunzip', "$cachedir/$filename") != 0) { + warn "gunzip of '$cachedir/$filename' failed" if $opt_v; + unlink "$cachedir/$filename"; + next; + } + } my $import_options = { 'file' => "$cachedir/$ungziped", |