5 # Manage network related configuration files
7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
22 MESSAGE=$"Generating network files"
28 for server in DB API BOOT WWW ; do
29 hostname=PLC_${server}_HOST
31 if [ -n "${!ip}" ] ; then
32 echo "${!ip} ${!hostname}"
34 ip=$(gethostbyname ${!hostname})
35 if [ -n "$ip" ] ; then
36 echo "$ip ${!hostname}"
41 if [ $PLC_DNS_ENABLED -eq 1 ] ; then
43 sort -u $hfile > $target
46 cat /etc/hosts >> $hfile
47 echo "#generated by /etc/plc.d/network" >/etc/hosts
48 echo "127.0.0.1 localhost.localdomain localhost" >>/etc/hosts
49 sort -u $hfile >> /etc/hosts
57 [ -n "$PLC_NET_DNS1" ] && echo "nameserver $PLC_NET_DNS1"
58 [ -n "$PLC_NET_DNS2" ] && echo "nameserver $PLC_NET_DNS2"
61 if [ $PLC_DNS_ENABLED -eq 1 ] ; then
62 target=/etc/plc_resolv.conf
64 target=/etc/resolv.conf