Commit | Line | Data |
---|---|---|
11492ebf C |
1 | #!/bin/sh |
2 | search -filter objectclass=applicationEntity -nosize -notime -nopart \ | |
3 | -type presentationaddress execvector supportedapplicationcontext \ | |
4 | -show -subtree -noseq \ | |
5 | | sed 's/cn=//g | |
6 | s/@/ /g | |
7 | s/ */ /g' | awk -F- ' | |
8 | BEGIN { | |
9 | print "# Flat representation of Application represented in the directory" | |
10 | print "# Format" | |
11 | print "# host : common name : application context : address : exec vector" | |
12 | print "" | |
13 | } | |
14 | { | |
15 | ||
16 | if ( NF == 1 ) { | |
17 | if (started == 1) { | |
18 | printf ":" | |
19 | if (sac != "") | |
20 | printf sac | |
21 | printf ":" | |
22 | if (addr != "") | |
23 | printf addr | |
24 | printf ":" | |
25 | if (exec != "") | |
26 | printf exec | |
27 | printf "\n" | |
28 | } else | |
29 | started = 1 | |
30 | ||
31 | sac = "" | |
32 | exec = "" | |
33 | addr = "" | |
34 | ||
35 | n = split ($1, sp, " ") | |
36 | ||
37 | tmp = sp[2] | |
38 | for (i=3; i<=n ; i++) | |
39 | tmp = tmp " " sp[i] | |
40 | ||
41 | printf "%-14s:%-20s", sp[1], tmp | |
42 | } else { | |
43 | tmp = $2; | |
44 | for (i=3; i<=NF ; i++) | |
45 | tmp = tmp "-" $i | |
46 | ||
47 | if ( $1 == "supportedApplicationContext ") | |
48 | sac = tmp | |
49 | else if ( $1 == "presentationAddress ") | |
50 | addr = tmp | |
51 | else if ( $1 == "execVector ") { | |
52 | tmp = $2; | |
53 | for (i=3; i<=NF ; i++) | |
54 | tmp = tmp " -" $i | |
55 | exec = tmp | |
56 | } else | |
57 | print "\n**ERROR**" $1 "*** unexpected" | |
58 | } | |
59 | ||
60 | ||
61 | } | |
62 | END { | |
63 | printf ":" | |
64 | if (sac != "") | |
65 | printf sac | |
66 | printf ":" | |
67 | if (addr != "") | |
68 | printf addr | |
69 | printf ":" | |
70 | if (exec != "") | |
71 | printf exec | |
72 | printf "\n" | |
73 | }' > quipuentities |