mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 17:32:43 +00:00
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.
This commit is contained in:
parent
5119d237e5
commit
e8b19bc63e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84026
@ -47,10 +47,13 @@ hostname=""
|
|||||||
while read a b c ; do
|
while read a b c ; do
|
||||||
if [ "$a" = "#ethertable" ] ; then
|
if [ "$a" = "#ethertable" ] ; then
|
||||||
hostname="."
|
hostname="."
|
||||||
elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ]
|
elif [ "X$hostname" = "X." -a "X$a" = "X#" ] ; then
|
||||||
then
|
case X${main_ether} in
|
||||||
|
X${b} ) # so we can use wildcards
|
||||||
hostname=$c
|
hostname=$c
|
||||||
break
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
done < /etc/hosts
|
done < /etc/hosts
|
||||||
if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
|
if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user