Merge pull request #327 from danimo/nfs_host_robustness

Rebustness fixes for NFS hostnames
master
Harald Hoyer 2017-12-18 09:13:29 +01:00 committed by GitHub
commit 84912dde41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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


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