net: Allow local.d configs to specify HOST / FQDN If you set HOST, ifconfig will create a line in /etc/hosts for the primary NIC's IP (ipifc/0). Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/kfs/ifconfig b/kern/kfs/ifconfig index 2e2e440..ba6316f 100755 --- a/kern/kfs/ifconfig +++ b/kern/kfs/ifconfig
@@ -101,6 +101,12 @@ fi # We also can provide an etc hosts file for loopback echo "127.0.0.1 localhost" >> /etc/hosts +# You can set HOST and then you may set FQDN, and we'll add it to etc hosts +if [ "x$HOST" != "x" ] +then + IP=`cat /net/ipifc/0/local | cut -f 1 -d ' '` + echo "$IP $FQDN $HOST" >> /etc/hosts +fi daemonize /bin/cs -S mount -a '#srv/cs' /net