mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 17:32:43 +00:00
Better code to scan the ethertable.
This commit is contained in:
parent
5a08b84f83
commit
6297e47a34
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85494
@ -59,10 +59,10 @@ get_ether() {
|
|||||||
|
|
||||||
# set "hostname" using $1 (ethernet address) as search key in /etc/hosts
|
# set "hostname" using $1 (ethernet address) as search key in /etc/hosts
|
||||||
fetch_hostname() {
|
fetch_hostname() {
|
||||||
local a b c key
|
local a b c key junk
|
||||||
key=$1 # search key
|
key=$1 # search key
|
||||||
hostname=""
|
hostname=""
|
||||||
while read a b c ; do
|
while read a b c junk ; do
|
||||||
if [ "$a" = "#ethertable" ] ; then
|
if [ "$a" = "#ethertable" ] ; then
|
||||||
hostname="."
|
hostname="."
|
||||||
elif [ "X$hostname" = "X." -a "X$a" = "X#" ] ; then
|
elif [ "X$hostname" = "X." -a "X$a" = "X#" ] ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user