summaryrefslogtreecommitdiff
path: root/bin/shadow.reimport
diff options
context:
space:
mode:
authorivan <ivan>2004-03-17 22:53:07 +0000
committerivan <ivan>2004-03-17 22:53:07 +0000
commitc2962f704aa7711489f2dd2fc8be3396095aa166 (patch)
tree2b413a7b91d7281d692e83a3bbf1533837001365 /bin/shadow.reimport
parent389dad7142dd7bf9c4b12d42958ebec50e4ae400 (diff)
allow multiple svcparts
Diffstat (limited to 'bin/shadow.reimport')
-rwxr-xr-xbin/shadow.reimport11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/shadow.reimport b/bin/shadow.reimport
index 846cb89..4d112d7 100755
--- a/bin/shadow.reimport
+++ b/bin/shadow.reimport
@@ -34,9 +34,10 @@ $FS::svc_Common::noexport_hack = 1;
die "No services with svcdb svc_acct!\n" unless %part_svc;
print "\n\n", &menu_svc, "\n", <<END;
-Enter part number to import.
+Enter part number or part numbers to import.
END
my($shell_svcpart)=&getpart;
+my @shell_svcpart = split(/[,\s]+/, $shell_svcpart);
print "\n\n", <<END;
Enter the location and name of your _user_ shadow file, for example
@@ -74,8 +75,12 @@ while (<SHADOW>) {
chop;
my($username,$password)=split(/:/);
- my @svc_acct = grep { $_->cust_svc->svcpart == $shell_svcpart }
- qsearch('svc_acct', { 'username' => $username } );
+# my @svc_acct = grep { $_->cust_svc->svcpart == $shell_svcpart }
+# qsearch('svc_acct', { 'username' => $username } );
+ my @svc_acct = grep {
+ my $svcpart = $_->cust_svc->svcpart;
+ grep { $_ == $svcpart } @shell_svcpart;
+ } qsearch('svc_acct', { 'username' => $username } );
next unless @svc_acct;