[freeside-commits] freeside/FS/bin freeside-adduser,1.9,1.10
Ivan,,,
ivan at wavetail.420.am
Thu Apr 13 14:29:03 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv25642
Modified Files:
freeside-adduser
Log Message:
don't do the duplicate check unless there's a file already; fixes problem with first use of freeside-adduser
Index: freeside-adduser
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-adduser,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- freeside-adduser 9 Apr 2006 20:36:06 -0000 1.9
+++ freeside-adduser 13 Apr 2006 21:29:01 -0000 1.10
@@ -13,13 +13,15 @@
die &usage if $opt_c && ! $opt_h;
my $user = shift or die &usage;
-open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
- or die "can't open $FREESIDE_CONF/mapsecrets: $!";
-while (<MAPSECRETS>) {
- /^(\S+) / or die "unparsable line in mapsecrets: $_";
- die "user $user already exists\n" if $user eq $1;
+if ( -e "$FREESIDE_CONF/mapsecrets" ) {
+ open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
+ or die "can't open $FREESIDE_CONF/mapsecrets: $!";
+ while (<MAPSECRETS>) {
+ /^(\S+) / or die "unparsable line in mapsecrets: $_";
+ die "user $user already exists\n" if $user eq $1;
+ }
+ close MAPSECRETS;
}
-close MAPSECRETS;
if ( $opt_h ) {
my @args = ( 'htpasswd' );
More information about the freeside-commits
mailing list