X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fpasswd.import;h=8ab9e2ae3c67a6a7efcbe94bd464acd64dfe135a;hp=aa4f90f98d95be2598893fd1f0692579f056d527;hb=51c0d6572357ba4d7c11a11e7ff506428c1cc045;hpb=7f1985f56afc81912dbc86a1a3178cd128af76fe diff --git a/bin/passwd.import b/bin/passwd.import index aa4f90f98..8ab9e2ae3 100755 --- a/bin/passwd.import +++ b/bin/passwd.import @@ -1,5 +1,4 @@ #!/usr/bin/perl -Tw -# $Id: passwd.import,v 1.2 2002-06-21 09:11:09 ivan Exp $ use strict; use vars qw(%part_svc); @@ -7,19 +6,19 @@ use Date::Parse; use Term::Query qw(query); use Net::SCP qw(iscp); use FS::UID qw(adminsuidsetup datasrc); -use FS::Record qw(qsearch); +use FS::Record qw(qsearch qsearchs); use FS::svc_acct; use FS::part_svc; my $user = shift or die &usage; adminsuidsetup $user; -push @FS::svc_acct::shells, qw(/bin/sync /sbin/shuddown /bin/halt); #others? +push @FS::svc_acct::shells, qw(/bin/sync /sbin/shutdown /bin/halt /sbin/halt); #others? my($spooldir)="/usr/local/etc/freeside/export.". datasrc; #$FS::svc_acct::nossh_hack = 1; -$FS::svc_acct::noexport_hack = 1; +$FS::svc_Common::noexport_hack = 1; ### @@ -76,6 +75,8 @@ while () { my($username,$password)=split(/:/); #$password =~ s/^\!$/\*/; #$password =~ s/\!+/\*SUSPENDED\* /; + $password =~ s/^NP$/\*/; + $password =~ s/^\*LK\*$/\*/; $password{$username}=$password; } @@ -86,10 +87,10 @@ while () { my $svcpart = $shell_svcpart; - if ( qsearchs('svc_acct', { 'username' => $username } ) ) { - warn "warning: $username already exists; skipping\n"; - next; - } + #if ( qsearchs('svc_acct', { 'username' => $username } ) ) { + # warn "warning: $username already exists; skipping\n"; + # next; + #} my($svc_acct) = new FS::svc_acct ({ 'svcpart' => $svcpart, @@ -104,7 +105,13 @@ while () { }); my($error); $error=$svc_acct->insert; - die $error if $error; + if ( $error ) { + if ( $error =~ /duplicate/i ) { + warn "$username: $error"; + } else { + die "$username: $error"; + } + } }