]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95nfs: Fix mount if IPv4 address is used in /etc/fstab
authorThomas Renninger <trenn@suse.com>
Wed, 4 May 2016 11:33:43 +0000 (13:33 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 20:52:28 +0000 (21:52 +0100)
Signed-off-by: Thomas Renninger <trenn@suse.com>
modules.d/95nfs/module-setup.sh

index 31d90d427ad5dfb0067d9e663b05146bcc3ac17b..6ef9cf321ac065157932a0316dc127096a6e7e5d 100755 (executable)
@@ -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')