diff --git a/executor-scripts/linux/link b/executor-scripts/linux/link index 9751987..9a716e1 100755 --- a/executor-scripts/linux/link +++ b/executor-scripts/linux/link @@ -4,10 +4,6 @@ set -e [ -n "$VERBOSE" ] && set -x -IF_LINK_OPTIONS="$IF_LINK_OPTIONS" -[ -n "$IF_MTU" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS mtu $IF_MTU" -[ -n "$IF_HWADDRESS" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS address $IF_HWADDRESS" - is_vlan() { case "$IFACE" in *#*) return 1 ;; @@ -64,14 +60,21 @@ pre-up) ${MOCK} ip link add link "${IF_VLAN_RAW_DEVICE}" name "${IFACE}" type vlan id "${IF_VLAN_ID}" fi ;; -up|down) - ${MOCK} ip link set $PHASE dev $IFACE $IF_LINK_OPTIONS +up) + IF_LINK_OPTIONS="$IF_LINK_OPTIONS" + [ -n "$IF_MTU" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS mtu $IF_MTU" + [ -n "$IF_HWADDRESS" ] && IF_LINK_OPTIONS="$IF_LINK_OPTIONS address $IF_HWADDRESS" + + ${MOCK} ip link set up dev "${IFACE}" ${IF_LINK_OPTIONS} # Set alias is configured if [ "${IF_ALIAS}" ]; then ${MOCK} ip link set alias "${IF_ALIAS}" dev "${IFACE}" fi ;; +down) + ${MOCK} ip link set down dev "${IFACE}" + ;; post-down) if [ "${IF_LINK_TYPE}" = "dummy" -o is_vlan ]; then if [ -d "/sys/class/net/${IFACE}" ]; then