projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83450 - fixed rateplan export
[freeside.git]
/
FS
/
FS
/
part_export
/
grandstream.pm
diff --git
a/FS/FS/part_export/grandstream.pm
b/FS/FS/part_export/grandstream.pm
index
90a87d8
..
981eb19
100644
(file)
--- a/
FS/FS/part_export/grandstream.pm
+++ b/
FS/FS/part_export/grandstream.pm
@@
-7,8
+7,9
@@
use MIME::Base64;
use Tie::IxHash;
use IPC::Run qw(run);
use FS::CGI qw(rooturl);
use Tie::IxHash;
use IPC::Run qw(run);
use FS::CGI qw(rooturl);
+use Carp qw(carp);
-$DEBUG =
1
;
+$DEBUG =
0
;
$me = '[' . __PACKAGE__ . ']';
$GAPSLITE_HOME = '/usr/local/src/GS_CFG_GEN/';
$me = '[' . __PACKAGE__ . ']';
$GAPSLITE_HOME = '/usr/local/src/GS_CFG_GEN/';
@@
-50,6
+51,12
@@
sub rebless { shift; }
sub gs_create_config {
my($self, $mac, %opt) = (@_);
sub gs_create_config {
my($self, $mac, %opt) = (@_);
+ if ( $FS::svc_Common::noexport_hack ) {
+ carp 'gs_create_config() suppressed by noexport_hack'
+ if $self->option('debug') || $DEBUG;
+ return;
+ }
+
eval "use Net::SCP;";
die $@ if $@;
eval "use Net::SCP;";
die $@ if $@;
@@
-89,8
+96,7
@@
sub gs_create_config {
'com.grandstream.cmd.TextEncoder',
$mac, $filename, "$dir/cfg$mac",
);
'com.grandstream.cmd.TextEncoder',
$mac, $filename, "$dir/cfg$mac",
);
- run \@cmd, '>&', \$out_and_err,
- },
+ run \@cmd, '>&', \$out_and_err
or die "grandstream encode failed: $out_and_err";
unlink $filename;
or die "grandstream encode failed: $out_and_err";
unlink $filename;
@@
-132,6
+138,12
@@
sub gs_create {
sub gs_delete {
my($self, $mac) = (shift, shift);
sub gs_delete {
my($self, $mac) = (shift, shift);
+ if ( $FS::svc_Common::noexport_hack ) {
+ carp 'gs_delete() suppressed by noexport_hack'
+ if $self->option('debug') || $DEBUG;
+ return;
+ }
+
$mac = sprintf('%012s', lc($mac));
ssh_cmd( user => $self->option('user'),
$mac = sprintf('%012s', lc($mac));
ssh_cmd( user => $self->option('user'),