diff options
author | ivan <ivan> | 2004-03-17 22:53:08 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-03-17 22:53:08 +0000 |
commit | 91afc5dc28aba2dd6a56ca57dc0c0ff1f3e1a710 (patch) | |
tree | ae76a7df23641428d6cc4c4d730a616351c4663d | |
parent | e2b2d1b90deb13b5da638b8340eec05957feabce (diff) |
allow multiple svcparts
-rwxr-xr-x | bin/shadow.reimport | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/shadow.reimport b/bin/shadow.reimport index a3347b478..4c0b8e50f 100755 --- a/bin/shadow.reimport +++ b/bin/shadow.reimport @@ -33,9 +33,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 @@ -73,8 +74,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; |