diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-05-28 10:52:36 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-05-28 10:52:36 +0200 |
commit | 04e6fde6090c8e4acf80ff89eba33ce6230661e3 (patch) | |
tree | f3ffeb9962426fba3e24dade128fdbc281b1420e /bin/itzks-hosts | |
parent | 534d486c36a75eab973327565ea4d03bb2337639 (diff) | |
download | itzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.tar.gz itzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.tar.bz2 itzks-systems-04e6fde6090c8e4acf80ff89eba33ce6230661e3.zip |
itzks-hosts: Properly list server machines.
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}";; |