diff options
author | ivan <ivan> | 2002-08-25 01:14:16 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-08-25 01:14:16 +0000 |
commit | ef92d87d1980598a4f786905ac7aff1af0ead2b8 (patch) | |
tree | bf1dcb7582a3d89ac3134ecad6609541d4806bef | |
parent | 8675d7f9367456118663ddc28907bcd69d6dae94 (diff) |
noninteractive freeside-setup
-rwxr-xr-x | FS/bin/freeside-setup | 77 |
1 files changed, 42 insertions, 35 deletions
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 21defa6e5..a14f0e12b 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -4,6 +4,8 @@ BEGIN { $FS::Record::setup_hack = 1; } use strict; +use vars qw($opt_s); +use Getopt::Std; use DBI; use DBIx::DBSchema 0.20; use DBIx::DBSchema::Table; @@ -21,6 +23,7 @@ die "Not running uid freeside!" unless checkeuid(); my %attrib2db = map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib; +getopts("s"); my $user = shift or die &usage; getsecrets($user); @@ -33,42 +36,46 @@ my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc; #my($username_len)=&getvalue; my $username_len = 32; #usernamemax config file -print "\n\n", <<END, ":"; -Freeside tracks the RADIUS User-Name, check attribute Password and -reply attribute Framed-IP-Address for each user. You can specify additional -check and reply attributes (or you can add them later with the -fs-radius-add-check and fs-radius-add-reply programs). - -First enter any additional RADIUS check attributes you need to track for each -user, separated by whitespace. -END -my @check_attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; } - split(" ",&getvalue); - -print "\n\n", <<END, ":"; -Now enter any additional reply attributes you need to track for each user, -separated by whitespace. -END -my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; } - split(" ",&getvalue); - -print "\n\n", <<END, ":"; -Do you wish to enable the tracking of a second, separate shipping/service -address? -END -my $ship = &_yesno; - -sub getvalue { - my($x)=scalar(<STDIN>); - chop $x; - $x; -} +#print "\n\n", <<END, ":"; +#Freeside tracks the RADIUS User-Name, check attribute Password and +#reply attribute Framed-IP-Address for each user. You can specify additional +#check and reply attributes (or you can add them later with the +#fs-radius-add-check and fs-radius-add-reply programs). +# +#First enter any additional RADIUS check attributes you need to track for each +#user, separated by whitespace. +#END +#my @check_attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; } +# split(" ",&getvalue); +# +#print "\n\n", <<END, ":"; +#Now enter any additional reply attributes you need to track for each user, +#separated by whitespace. +#END +#my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; } +# split(" ",&getvalue); +# +#print "\n\n", <<END, ":"; +#Do you wish to enable the tracking of a second, separate shipping/service +#address? +#END +#my $ship = &_yesno; +# +#sub getvalue { +# my($x)=scalar(<STDIN>); +# chop $x; +# $x; +#} +# +#sub _yesno { +# print " [y/N]:"; +# my $x = scalar(<STDIN>); +# $x =~ /^y/i; +#} -sub _yesno { - print " [y/N]:"; - my $x = scalar(<STDIN>); - $x =~ /^y/i; -} +my @check_attributes = (); #add later +my @attributes = (); #add later +my $ship = $opt_s; ### |