]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(network-legacy): silent check for leaseinfo
authorHarald Hoyer <harald@redhat.com>
Mon, 8 Feb 2021 15:03:25 +0000 (16:03 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 8 Feb 2021 16:18:02 +0000 (17:18 +0100)
Reroute negative checks for leaseinfo to /dev/null to suppress:
```
ls: cannot access '/tmp/leaseinfo.ens2*': No such file or directory
```

modules.d/35network-legacy/ifup.sh

index 130b799f364d9025b4a8ba4e99b5b7f03b25037b..e5690dbec2496e7d6a85c98baeb31e868afd6a8d 100755 (executable)
@@ -515,7 +515,7 @@ if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then
         echo nameserver $s >> /tmp/net.$netif.resolv.conf
     done
 
-    if [ "$ret" -eq 0 ] && [ -n "$(ls /tmp/leaseinfo.${netif}*)" ]; then
+    if [ "$ret" -eq 0 ] && [ -n "$(ls /tmp/leaseinfo.${netif}* 2>/dev/null)" ]; then
          > /tmp/net.${netif}.did-setup
          if [ -e /sys/class/net/${netif}/address ]; then
              > /tmp/net.$(cat /sys/class/net/${netif}/address).did-setup