NFS: Support host being a DNS ALIAS

The "host" command may also print something else than
"asdf.local.lan has address 1.2.3.4", like:
"rootserver.local.net is an alias for rainbow.local.net.".
So "head -n1" is not enough.

Fixes boo#955592
master
Fabian Vogt 2017-02-03 16:02:33 +01:00 committed by Daniel Molkentin
parent f5c10673de
commit 8602e59867
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ cmdline() {
if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
nfs_address="${nfs_device%%:*}"
else
lookup=$(host "${nfs_device%%:*}"| head -n1)
lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1)
nfs_address=${lookup##* }
fi
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')