link executor: Only create dummy interface when not present.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
parent
375b5d46cb
commit
7d81ceb898
1 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,13 @@ is_vlan() {
|
|||
case "$PHASE" in
|
||||
pre-up)
|
||||
if [ "${IF_LINK_TYPE}" = "dummy" ]; then
|
||||
if [ -d "/sys/class/net/${IFACE}" ]; then
|
||||
iface_type=$(ip -d link show dev "${IFACE}" | head -n3 | tail -n1 | awk '{ print $1 }')
|
||||
if [ "${iface_type}" = 'dummy' ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
ip link add "${IFACE}" type dummy
|
||||
fi
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue