This commit was generated by cvs2svn to compensate for changes in r4888,
[freeside.git] / FS / bin / freeside-sqlradius-reset
index 95b7ef2..2ac5012 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -Tw
+#!/usr/bin/perl -w
 
 use strict;
 use FS::UID qw(adminsuidsetup);
@@ -13,8 +13,8 @@ adminsuidsetup $user;
 #my $machine = shift or die &usage;
 
 my @exports = ();
-if ( @_ ) {
-  foreach my $exportnum ( @_ ) {
+if ( @ARGV ) {
+  foreach my $exportnum ( @ARGV ) {
     foreach my $exporttype (qw( sqlradius sqlradius_withdomain )) {
     push @exports, qsearch('part_export', { exportnum  => $exportnum,
                                             exporttype => $exporttype, } );
@@ -48,6 +48,9 @@ foreach my $export ( @exports ) {
 
   foreach my $svc_acct ( @svc_acct ) {
 
+    $svc_acct->check; #set any fixed usergroup so it'll export even if all
+                      #svc_acct records don't have the group yet
+
     #false laziness with FS::svc_acct::insert (like it matters)
     my $error = $export->export_insert($svc_acct);
     die $error if $error;