summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2001-10-30 13:47:07 +0000
committerivan <ivan>2001-10-30 13:47:07 +0000
commita8989c556a7a1951a0b34942c6289f26395859d7 (patch)
tree165dd906f6557b97108cc0d2aed76f8ec6afd72d /FS
parent56fc68db7603aaa06df25bb053d46cdfb2599c18 (diff)
`make create-config' installs default config (conf dir update)
freeside-adduser uses default secrets file
Diffstat (limited to 'FS')
-rw-r--r--FS/bin/freeside-adduser15
1 files changed, 9 insertions, 6 deletions
diff --git a/FS/bin/freeside-adduser b/FS/bin/freeside-adduser
index e66b0d012..7fc5830db 100644
--- a/FS/bin/freeside-adduser
+++ b/FS/bin/freeside-adduser
@@ -1,16 +1,15 @@
#!/usr/bin/perl -w
#
-# $Id: freeside-adduser,v 1.2 2001-10-30 11:47:54 ivan Exp $
+# $Id: freeside-adduser,v 1.3 2001-10-30 13:47:07 ivan Exp $
use strict;
-use vars qw($opt_h $opt_c);
+use vars qw($opt_h $opt_c $opt_s);
use Getopt::Std;
my $FREESIDE_CONF = "/usr/local/etc/freeside";
-getopts("ch:");
+getopts("ch:s:");
die &usage if $opt_c && ! $opt_h;
-my $secretfile = shift or die &usage;
my $user = shift or die &usage;
my @args = ( 'htpasswd' );
@@ -18,13 +17,15 @@ push @args, '-c' if $opt_c;
push @args, $opt_h, $user;
system(@args) == 0 or die "htpasswd failed: $?";
+my $secretfile = $opt_s || 'secrets';
+
open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
or die "can't open $FREESIDE_CONF/mapsecrets: $!";
print MAPSECRETS "$user $secretfile\n";
close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
sub usage {
- die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username"
+ die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] ] [ -s secretfile ] username"
}
=head1 NAME
@@ -33,7 +34,7 @@ freeside-adduser - Command line interface to add (freeside) users.
=head1 SYNOPSIS
- freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username
+ freeside-adduser [ -h htpasswd_file [ -c ] ] [ -s secretfile ] username
=head1 DESCRIPTION
@@ -44,6 +45,8 @@ sales/tech folks) to the web interface, not for adding customer accounts.
-c: Passed to htpasswd
+ -s: Specify an alternate secret file
+
=head1 SEE ALSO
L<htpasswd>, base Freeside documentation