From e8b19bc63e814ad5165b3c9ff1d9f347e4f49e14 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 27 Sep 2001 16:47:45 +0000 Subject: [PATCH] Enable the use of wildcards in the #ethertable section of /etc/hosts to map MAC addresses to hostnames. Main use is to get addresses for vmware interfaces. --- release/picobsd/floppy.tree/etc/rc.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/release/picobsd/floppy.tree/etc/rc.conf b/release/picobsd/floppy.tree/etc/rc.conf index d597aa80f0ad..1e854f65bed2 100644 --- a/release/picobsd/floppy.tree/etc/rc.conf +++ b/release/picobsd/floppy.tree/etc/rc.conf @@ -47,10 +47,13 @@ hostname="" while read a b c ; do if [ "$a" = "#ethertable" ] ; then hostname="." - elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ] - then - hostname=$c - break + elif [ "X$hostname" = "X." -a "X$a" = "X#" ] ; then + case X${main_ether} in + X${b} ) # so we can use wildcards + hostname=$c + break + ;; + esac fi done < /etc/hosts if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then