Created
December 14, 2012 06:53
Revisions
-
hiroyuki-sato created this gist
Dec 14, 2012 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/usr/bin/ruby -w print <<EOF dn: cn={99}openam objectClass: olcSchemaConfig cn: {99}openam EOF idx = { "attributeTypes" => 1, "objectClasses" => 1 } while ( line = ARGF.gets ) line.chomp! if( line =~ /attributeTypes:\s+(.*)/ ) v = $1 i = idx["attributeTypes"]; puts "olcAttributeTypes: {#{i}}#{v}" i = idx["attributeTypes"] += 1 elsif( line =~ /objectClasses:\s+(.*)/ ) v = $1 i = idx["objectClasses"]; puts "olcObjectClasses: {#{i}}#{v}" i = idx["objectClasses"] += 1 else # do nothing end end