[projects/rc-scripts] Create bond master interface if it doesn't exist when slave interface is being ifuped.

arekm arekm at pld-linux.org
Mon Mar 4 10:19:32 CET 2019


commit 83014f96551132c825ff52d94330e366148f20cb
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 4 10:19:27 2019 +0100

    Create bond master interface if it doesn't exist when slave interface is being ifuped.

 lib/ifup | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/lib/ifup b/lib/ifup
index dee4e58b..38780bf4 100755
--- a/lib/ifup
+++ b/lib/ifup
@@ -125,6 +125,9 @@ if [ -n "$ETHTOOL_OPTS" ] ; then
 fi
 
 if is_yes "$SLAVE" && [ -n "$MASTER" ] ; then
+    # create master if it doesn't exist yet
+    [ ! -d "/sys/class/net/${MASTER}" ] && ip link add "${MASTER}" type bond
+
     nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
     ip link set "$DEVICE" master "$MASTER"
     ip link set "$DEVICE" up
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/83014f96551132c825ff52d94330e366148f20cb



More information about the pld-cvs-commit mailing list