accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1399719 - /accumulo/branches/1.4.2/bin/start-server.sh
Date Thu, 18 Oct 2012 16:12:52 GMT
Author: ecn
Date: Thu Oct 18 16:12:52 2012
New Revision: 1399719

URL: http://svn.apache.org/viewvc?rev=1399719&view=rev
Log:
ACCUMULO-823 use alternatives to ipconfig, merge to 1.4.2

Modified:
    accumulo/branches/1.4.2/bin/start-server.sh

Modified: accumulo/branches/1.4.2/bin/start-server.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4.2/bin/start-server.sh?rev=1399719&r1=1399718&r2=1399719&view=diff
==============================================================================
--- accumulo/branches/1.4.2/bin/start-server.sh (original)
+++ accumulo/branches/1.4.2/bin/start-server.sh Thu Oct 18 16:12:52 2012
@@ -37,7 +37,16 @@ then
 fi
 SLAVES=`wc -l < ${ACCUMULO_HOME}/conf/slaves`
 
-ip=`ifconfig | grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v 0.0.0.0 | grep
-v 127.0.0.1 | head -n 1`
+IFCONFIG=/sbin/ifconfig
+if [ ! -x $IFCONFIG ]
+then
+   IFCONFIG='/bin/netstat -ie'
+fi
+ip=`$IFCONFIG 2>/dev/null| grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v
0.0.0.0 | grep -v 127.0.0.1 | head -n 1`
+if [ $? != 0 ]
+then
+  ip=`python -c 'import socket as s; print s.gethostbyname(s.getfqdn())'`
+fi
 
 if [ $HOST == localhost -o $HOST == "`hostname`" -o $HOST == "$ip" ] 
 then



Mime
View raw message