batman executor: Only create/delete iface if (not) present.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
parent
be6ce3c319
commit
017a12760c
1 changed files with 7 additions and 3 deletions
|
@ -71,7 +71,10 @@ case "${PHASE}" in
|
||||||
pre-up)
|
pre-up)
|
||||||
# Main B.A.T.M.A.N. adv. interface
|
# Main B.A.T.M.A.N. adv. interface
|
||||||
if [ "${IF_BATMAN_IFACES}" ]; then
|
if [ "${IF_BATMAN_IFACES}" ]; then
|
||||||
|
if [ ! -d "/sys/class/net/${IFACE}" ]; then
|
||||||
batctl "${mesh_if_param}" "${IFACE}" interface create || true
|
batctl "${mesh_if_param}" "${IFACE}" interface create || true
|
||||||
|
fi
|
||||||
|
|
||||||
batctl_if add
|
batctl_if add
|
||||||
set_batmam_params
|
set_batmam_params
|
||||||
|
|
||||||
|
@ -82,7 +85,7 @@ case "${PHASE}" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
post-down)
|
post-down)
|
||||||
if [ "${IF_BATMAN_IFACES}" ]; then
|
if [ "${IF_BATMAN_IFACES}" -a -d "/sys/class/net/${IFACE}" ]; then
|
||||||
# Newer versions of batctl provide the "interface destroy" API, try to use it
|
# 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
|
if ! batctl "${mesh_if_param}" "${IFACE}" interface destroy 2>/dev/null; then
|
||||||
# Fall back to old style member interface removal
|
# Fall back to old style member interface removal
|
||||||
|
@ -91,6 +94,7 @@ case "${PHASE}" in
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*) exit 0
|
*)
|
||||||
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue