- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Radius - File to Mysql Migration
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 08:22 AM
тАО08-18-2011 08:22 AM
Have a radius users file, I need to parse and reformat into a CSV file to insert into the userinfo table
Each record in the file is two lines.
0011aa22b3cc Auth-Type := Local, User-Password == "0011aa22b3cc "
#Jane Doe Dell_D820
Radius requires the MAC to be in 00:00:00:00:00:00
and I need to get the second line into the same line position
I was attempting to use Awk with a substr substittution on the MAC but I am failing miserably.
We are in process of attempting to migrate from a very old revision of freeradius to one that runs under a mysql database.
Any suggestions appreciates..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:08 AM
тАО08-18-2011 09:08 AM
SolutionHi:
See if this little bit of Perl helps you:
# cat ./format
#!/usr/bin/perl use strict; use warnings; while (<>) { chomp; $_ .= q( ) . <> unless eof; my @F = split; my @m = unpack("a2"x6,$F[0]); $F[0] = sprintf join ":", @m; print "@F\n"; } 1;
Run as:
# ./format file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:09 AM
тАО08-18-2011 09:09 AM
Re: Radius - File to Mysql Migration
Thanks James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:13 AM
тАО08-18-2011 09:13 AM
Re: Radius - File to Mysql Migration
James,
I am getting an error when running. Any suggestions?
./reformat: line 5: syntax error near unexpected token `)'
./reformat: line 5: `while (<>) {'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:15 AM
тАО08-18-2011 09:15 AM
Re: Radius - File to Mysql Migration
Disregard, I forgot to put #!/usr/bin/perl at top line. Fixed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:31 AM
тАО08-18-2011 09:31 AM
Re: Radius - File to Mysql Migration
@rmueller58 wrote:Disregard, I forgot to put #!/usr/bin/perl at top line. Fixed.
Yes, that would cause the shell to try an interpret it :-)
Does this do what you need?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 09:51 AM
тАО08-18-2011 09:51 AM
Re: Radius - File to Mysql Migration
James, did the trick,
Now I need to get create CSV record to import. I think can go from here.
Thanks again,
the new forum interface is a bit intimidating for some reason. Guess I've not been on for quite a while.
Kudos to JRF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2011 10:08 AM
тАО08-18-2011 10:08 AM
Re: Radius - File to Mysql Migration
@rmueller58 wrote:James, did the trick
Kudos to JRF.
To assign those, see:
http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos
and, since marking a post "solved" doesn't assign kudos, but is of great value, too:
http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/solutions#solutions
Regards!
...JRF...