diff options
author | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
commit | 58d093219cf60264550b8c34649d9f3190eda042 (patch) | |
tree | 10418dd70b52416a5f52da8e17d8e282d914595d /bin/fs-radius-add-reply | |
parent | 3ce7691203a7737406bf2d4442f7fd84b81f847e (diff) |
This commit was manufactured by cvs2svn to create tagAFTER_FINAL_MASONIZE
'AFTER_FINAL_MASONIZE'.
Diffstat (limited to 'bin/fs-radius-add-reply')
-rwxr-xr-x | bin/fs-radius-add-reply | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/bin/fs-radius-add-reply b/bin/fs-radius-add-reply deleted file mode 100755 index 3de01374f..000000000 --- a/bin/fs-radius-add-reply +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/perl -Tw - -# quick'n'dirty hack of fs-setup to add radius attributes - -use strict; -use DBI; -use FS::UID qw(adminsuidsetup checkeuid getsecrets); -use FS::raddb; - -die "Not running uid freeside!" unless checkeuid(); - -my %attrib2db = - map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib; - -my $user = shift or die &usage; -getsecrets($user); - -my $dbh = adminsuidsetup $user; - -### - -print "\n\n", <<END, ":"; -Enter the additional RADIUS reply attributes you need to track for -each user, separated by whitespace. -END -my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; } - split(" ",&getvalue); - -sub getvalue { - my($x)=scalar(<STDIN>); - chop $x; - $x; -} - -### - -my($char_d) = 80; #default maxlength for text fields - -### - -foreach my $attribute ( @attributes ) { - - my $statement = - "ALTER TABLE svc_acct ADD COLUMN radius_$attribute varchar($char_d) NULL"; - my $sth = $dbh->prepare( $statement ) - or warn "Error preparing $statement: ". $dbh->errstr; - my $rc = $sth->execute - or warn "Error executing $statement: ". $sth->errstr; - - $statement = - "ALTER TABLE h_svc_acct ADD COLUMN radius_$attribute varchar($char_d) NULL"; - $sth = $dbh->prepare( $statement ) - or warn "Error preparing $statement: ". $dbh->errstr; - $rc = $sth->execute - or warn "Error executing $statement: ". $sth->errstr; - -} - -$dbh->commit or die $dbh->errstr; - -$dbh->disconnect or die $dbh->errstr; - -print "\n\n", "Now you must run dbdef-create.\n\n"; - -sub usage { - die "Usage:\n fs-radius-add-reply user\n"; -} - - |