95nfs: Fix mount if IPv4 address is used in /etc/fstab

Signed-off-by: Thomas Renninger <trenn@suse.com>
master
Thomas Renninger 2016-05-04 13:33:43 +02:00 committed by Daniel Molkentin
parent 611b8ae0d7
commit f5c10673de
1 changed files with 2 additions and 2 deletions

View File

@ -51,9 +51,9 @@ cmdline() {

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