X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fnetwork;h=9df70e4356343ba3efdd225d7d56591b10e64edf;hb=391310e122de0536c08f62bd46acd3b3b7b13964;hp=b412d180f5589bc04b3d382884af56b6dfe58e60;hpb=f872afaa7976264819814d3e3289e020c0f77eae;p=myplc.git diff --git a/plc.d/network b/plc.d/network index b412d18..9df70e4 100755 --- a/plc.d/network +++ b/plc.d/network @@ -7,11 +7,15 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: guest.init,v 1.12 2006/04/04 22:09:47 mlhuang Exp $ +# $Id: network 129 2007-03-20 12:04:03Z thierry $ # # Source function library and configuration . /etc/plc.d/functions +. /etc/planetlab/plc_config + +# Be verbose +set -x case "$1" in start) @@ -21,11 +25,16 @@ case "$1" in # Minimal /etc/hosts echo "127.0.0.1 localhost.localdomain localhost" >/etc/hosts ( - for server in API BOOT WWW ; do + for server in DB API BOOT WWW ; do hostname=PLC_${server}_HOST - ip=$(gethostbyname ${!hostname}) - if [ -n "$ip" ] ; then - echo "$ip $hostname" + ip=PLC_${server}_IP + if [ -n "${!ip}" ] ; then + echo "${!ip} ${!hostname}" + else + ip=$(gethostbyname ${!hostname}) + if [ -n "$ip" ] ; then + echo "$ip ${!hostname}" + fi fi done ) >>/etc/hosts