diff options
author | ivan <ivan> | 2008-06-23 22:11:21 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-06-23 22:11:21 +0000 |
commit | 80ff02710fb34b6d59adc7095cdf744b2cab3eaf (patch) | |
tree | 23a4919522c0feb0e35d56605b3a6920a76615fd /bin | |
parent | 5bc6e3dc0b986d70b7b5b1a63916dbe7e8c33faa (diff) |
add quick command line too for CDR imports
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cdr.import | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/cdr.import b/bin/cdr.import new file mode 100644 index 000000000..a3508bc8b --- /dev/null +++ b/bin/cdr.import @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Usage: +# cdr.import user format <filename +# + +use strict; +use FS::UID qw(adminsuidsetup); +use FS::cdr; + +my $user = shift or die &usage; +adminsuidsetup $user; + +my $format = shift or die &usage; + +my $error = FS::cdr::batch_import( { + 'filehandle' => *STDIN{IO}, + 'format' => $format, +} ); +die $error if $error; + +sub usage { + "Usage: \n cdr.import user format <filename\n"; +} + |