From 04e6fde6090c8e4acf80ff89eba33ce6230661e3 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 May 2019 10:52:36 +0200 Subject: itzks-hosts: Properly list server machines. --- bin/itzks-hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/itzks-hosts') 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}";; -- cgit v1.2.3