|
|
1.1 root 1: #!/bin/sh
2: awk '
3: BEGIN {
4: default["iso ftam"] = "#259/"
5: default["iso vt"] = "#260/"
6: default["iso cmip"] = "#261/"
7: default["isode miscellany"] = "#518/"
8: default["isode shell"] = "#524/"
9: default["isode idist"] = "#525/"
10:
11: print "#!/bin/sh"
12: }
13: {
14: if ( substr($0,1,1) == "#" )
15: next
16: if ( $1 == "" )
17: next
18:
19: tmp = $2
20: for (i=3; i<=NF-1; i++)
21: tmp = tmp " " $i
22:
23: if ( last != $1 ) {
24: last = $1
25: dn = "\"cn=" $1 "\""
26: print "if ( showname " dn " 1>/dev/null 2>&1 )\nthen"
27: print "\techo " dn "..."
28: print "else"
29: print "\techo \"objectClass=applicationProcess & quipuObject\" > /tmp/aet$$"
30: print "\tadd \"cn=" $1 "\" -draft /tmp/aet$$ -noedit"
31: print "fi\n"
32: }
33:
34: if ( $2 == "default" ) {
35: print "# Adding default services"
36:
37: for (i in default) {
38: dn = "\"cn=" last "@cn=" i "\""
39: print "if ( showentry " dn " -edb -all > /tmp/zaet$$ 2>/dev/null )\nthen"
40: print "\tsed \"s@presentationAddress= .*@presentationAddress= " default[i] $NF "@\" <>/tmp/zaet$$ >/tmp/aet$$ "
41: print "\tmodify " dn " -draft /tmp/aet$$ -noedit"
42: print "\trm -f /tmp/zaet$$"
43: print "else"
44: print "\techo \"supportedApplicationContext=" i "\" > /tmp/aet$$"
45: print "\techo '\''presentationAddress=" default[i] $NF "'\'' >> /tmp/aet$$"
46: print "\techo \"objectClass=applicationEntity & quipuObject\" >> /tmp/aet$$"
47: print "\tadd " dn " -draft /tmp/aet$$ -noedit"
48: print "fi"
49: }
50: } else {
51: print "# Adding named service"
52: dn = "\"cn=" last "@cn=" tmp "\""
53: print "if ( showentry " dn " -edb -all > /tmp/zaet$$ 2>/dev/null )\nthen"
54: print "\tsed \"s@presentationAddress= .*@presentationAddress= " $NF "@\" <>/tmp/zaet$$ >/tmp/aet$$ "
55: print "\tmodify " dn " -draft /tmp/aet$$ -noedit"
56: print "\trm -f /tmp/zaet$$"
57: print "else"
58: print "\techo \"supportedApplicationContext=" tmp "\" > /tmp/aet$$"
59: print "\techo '\''presentationAddress=" $NF "'\'' >> /tmp/aet$$"
60: print "\techo \"objectClass=applicationEntity & quipuObject\" >> /tmp/aet$$"
61: print "\tadd " dn " -draft /tmp/aet$$ -noedit"
62: print "fi\n"
63: }
64:
65: }
66: END {
67: print "rm -f /tmp/aet$$"
68: } '
69:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.