projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3fcc93
)
add service replacement script, RT#40031
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 2 Feb 2016 23:12:40 +0000
(15:12 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 2 Feb 2016 23:12:40 +0000
(15:12 -0800)
bin/svc.replace
[new file with mode: 0644]
patch
|
blob
diff --git a/bin/svc.replace
b/bin/svc.replace
new file mode 100644
(file)
index 0000000..
1d2513a
--- /dev/null
+++ b/
bin/svc.replace
@@ -0,0
+1,21
@@
+#!/usr/bin/perl -w
+
+use strict;
+use FS::UID qw( adminsuidsetup );
+use FS::Record qw( qsearch );
+use FS::cust_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup;
+
+my $svcpart = shift or die &usage;
+
+foreach my $cust_svc ( qsearch('cust_svc', { 'svcpart'=>$svcpart } ) ) {
+ my $svc_x = $cust_svc->svc_x;
+ my $error = $svc_x->replace;
+ warn "$error\n" if $error
+}
+
+sub usage {
+ die "Usage\n\n svc.replace user svcpart\n";
+}