batman executor: Use create/destroy phases
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
parent
017a12760c
commit
35e03475e4
1 changed files with 7 additions and 2 deletions
|
@ -68,13 +68,18 @@ case "${PHASE}" in
|
|||
fi
|
||||
;;
|
||||
|
||||
pre-up)
|
||||
create)
|
||||
# Main B.A.T.M.A.N. adv. interface
|
||||
if [ "${IF_BATMAN_IFACES}" ]; then
|
||||
if [ ! -d "/sys/class/net/${IFACE}" ]; then
|
||||
batctl "${mesh_if_param}" "${IFACE}" interface create || true
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
pre-up)
|
||||
# Main B.A.T.M.A.N. adv. interface
|
||||
if [ "${IF_BATMAN_IFACES}" ]; then
|
||||
batctl_if add
|
||||
set_batmam_params
|
||||
|
||||
|
@ -84,7 +89,7 @@ case "${PHASE}" in
|
|||
fi
|
||||
;;
|
||||
|
||||
post-down)
|
||||
destroy)
|
||||
if [ "${IF_BATMAN_IFACES}" -a -d "/sys/class/net/${IFACE}" ]; then
|
||||
# Newer versions of batctl provide the "interface destroy" API, try to use it
|
||||
if ! batctl "${mesh_if_param}" "${IFACE}" interface destroy 2>/dev/null; then
|
||||
|
|
Loading…
Reference in a new issue