Hi,
i've got a text file with over 100 usernames and ip-addresses that are wrong in my ldap, i need to add /32 to the ip-addresses.
I don't have much knowledge of perl or other programming languages.
Now i'm looking for a way to adjust the username & ip-address so i can run an ldapmodify to correct all the wrong ip-addresses.
I don't now how to do it with perl, can someone help me in the right direction?
source file: users.txt
dn: uid=donald,nameSpace=mydomain.com,ou=users,o=sp
radiusFramedAddress: 192.168.0.2
dn: uid=mario,nameSpace=mydomain.com,ou=users,o=sp
radiusFramedAddress: 192.168.0.7
dn: uid=thijs,nameSpace=mydomain.com,ou=users,o=sp
radiusFramedAddress: 192.168.11.15
i'd would like to create a target file with the syntax that's below.
target file: addme.txt
dn: uid=donald,nameSpace=mydomain.com,ou=users,o=sp
changeType: modify
replace: radiusFramedAddress
radiusFramedAddress: 192.168.0.2/32
dn: uid=mario,nameSpace=mydomain.com,ou=users,o=sp
changeType: modify
replace: radiusFramedAddress
radiusFramedAddress: 192.168.0.7/32
dn: uid=thijs,nameSpace=mydomain.com,ou=users,o=sp
changeType: modify
replace: radiusFramedAddress
radiusFramedAddress: 192.168.11.15/32
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.