diff options
Diffstat (limited to 'bin/itzks-hosts')
-rwxr-xr-x | bin/itzks-hosts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/itzks-hosts b/bin/itzks-hosts index bb5239b..7d7f04f 100755 --- a/bin/itzks-hosts +++ b/bin/itzks-hosts @@ -2,13 +2,13 @@ set -e -ldapsearch -xLLL "(&(cn=*)(objectClass=ipHost))" \ +ldapsearch -xLLL "(&(cn=*)(|(objectClass=ipHost)(objectClass=goServer)))" \ cn ipHostNumber macAddress description 2>/dev/null | perl -p0e 's/\n //g' | \ while read KEY VALUE ; do case "$KEY" in dn:) HOSTNAME= ; IP= ; MAC= ; DESC= ; DN=${VALUE} - OU=$(echo $DN | sed -r -e 's/cn=[^,]+,ou=[^,]+,ou=[^,]+,ou=([^,]+),.*/\1/') + OU=$(echo $DN | sed -r -e 's/cn=[^,]+,ou=[^,]+,ou=[^,]+,ou=([^,]+),.*/\1/' | sed -r -e 's/cn=[^,]+,ou=[^,]+,ou=[^,]+,dc=.*/Servers/g') ;; cn:) HOSTNAME="${VALUE}";; ipHostNumber:) IP="${VALUE}";; |