summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-05-28 10:52:36 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-05-28 10:52:36 +0200
commit04e6fde6090c8e4acf80ff89eba33ce6230661e3 (patch)
treef3ffeb9962426fba3e24dade128fdbc281b1420e
parent534d486c36a75eab973327565ea4d03bb2337639 (diff)
downloaditzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.zip
itzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.tar.gz
itzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.tar.bz2
itzks-hosts: Properly list server machines.
-rwxr-xr-xbin/itzks-hosts4
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}";;