[Fai-commit] r3694 - trunk/bin

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Sun Jul 30 17:35:24 UTC 2006


Author: lange
Date: 2006-07-30 17:35:23 +0000 (Sun, 30 Jul 2006)
New Revision: 3694

Modified:
   trunk/bin/fai-setup
Log:
use getent for getting IP address


Modified: trunk/bin/fai-setup
===================================================================
--- trunk/bin/fai-setup	2006-07-30 17:34:32 UTC (rev 3693)
+++ trunk/bin/fai-setup	2006-07-30 17:35:23 UTC (rev 3694)
@@ -102,7 +102,7 @@
 	if [ ! -f $sshdir/known_hosts ]; then
 	    echo "Using interface $SERVERINTERFACE to determine local hostname."
 	    SERVERIP=`LC_ALL=C ifconfig $SERVERINTERFACE | perl -ne '/inet addr:([0-9\.]+)/ && print $1'`
-	    HOSTNAME=`grep $SERVERIP /etc/hosts | perl -p -e 's/[\d.\s]*([\w-]*).*// && print $1'`
+	    HOSTNAME=`getent hosts $SERVERIP | perl -p -e 's/[\d.\s]*([\w-]*).*// && print $1'`
 	    echo "Adding $HOSTNAME to known_hosts."
 	    [ -f /etc/ssh/ssh_host_dsa_key.pub ] && DSASERVER=` cat /etc/ssh/ssh_host_dsa_key.pub | sed -e "s/= .*$/=/"`
 	    [ -f /etc/ssh/ssh_host_rsa_key.pub ] && RSASERVER=` cat /etc/ssh/ssh_host_rsa_key.pub | sed -e "s/= .*$/=/"`




More information about the Fai-commit mailing list