Update executors to reflect new create/destroy phase.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-09-10 00:48:35 +02:00
parent e6c6f49143
commit af94d760d0
7 changed files with 37 additions and 18 deletions

View file

@ -4,6 +4,7 @@ set -e
# Copyright (C) 2012, 2020 Natanael Copa <ncopa@alpinelinux.org>
# Copyright (C) 2020 Ariadne Conill <ariadne@dereferenced.org>
# Copyright (C) 2020 Maximilian Wilhelm <max@sdn.clinic>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@ -134,8 +135,12 @@ esac
[ -z "$PORTS" ] && ! env | grep -q "^IF_BRIDGE" && exit
case "$PHASE" in
create)
if [ ! -d "/sys/class/net/${IFACE}" ]; then
brctl addbr "${IFACE}"
fi
;;
pre-up)
brctl addbr $IFACE || exit 1
wait_ports
set_bridge_opts
add_ports
@ -144,6 +149,10 @@ pre-up)
post-down)
del_ports
ip link set dev $IFACE down
brctl delbr $IFACE || exit 1
;;
destroy)
if [ -d "/sys/class/net/${IFACE}" ]; then
brctl delbr "${IFACE}"
fi
;;
esac