[FreeNX-kNX] FreeNX XDM support A diff - u patch for nxnode
Fritz Elfert
fritz at fritz-elfert.de
Mon Nov 28 22:03:04 UTC 2011
Just another note on your patch:
I noticed the following line which is supposed to retrieve the IP
address of a given hostname:
XDM_HOST_ADDRESS=$(dig +short +search $XDM_HOST|egrep
"^([0-9]{1,3}[.]){3}[0-9]{1,3}$"|tr "\n" " "|cut -d " " -f1)
I'd suggest to use the following perl 1-liner instead:
XDM_HOST_ADDRESS=
$(perl -e 'use Socket;@a=gethostbyname shift;print inet_ntoa @a[4];'
$XDM_HOST)
Advantage: It also resolves names from /etc/hosts (dig, nslookup and
host all use DNS only). Furthermore, dig, nslookup or host might not be
available on any system while perl - at least the core - certainly is.
(e.g: On my Fedora, dig belongs to the bind-utils package)
Cheers
-Fritz
More information about the FreeNX-kNX
mailing list