#!/usr/bin/perl -w
#
-# $Id: freeside-adduser,v 1.3 2001-10-30 13:47:07 ivan Exp $
+# $Id: freeside-adduser,v 1.4 2002-02-06 14:58:05 ivan Exp $
use strict;
use vars qw($opt_h $opt_c $opt_s);
die &usage if $opt_c && ! $opt_h;
my $user = shift or die &usage;
-my @args = ( 'htpasswd' );
-push @args, '-c' if $opt_c;
-push @args, $opt_h, $user;
-system(@args) == 0 or die "htpasswd failed: $?";
+if ( $opt_h ) {
+ my @args = ( 'htpasswd' );
+ push @args, '-c' if $opt_c;
+ push @args, $opt_h, $user;
+ system(@args) == 0 or die "htpasswd failed: $?";
+}
my $secretfile = $opt_s || 'secrets';