fff-babel: Make implementation runtime switchable #201
|
@ -12,7 +12,6 @@ define Package/fff-babel-bird2
|
|||
URL:=https://www.freifunk-franken.de
|
||||
DEPENDS:=+bird2 +bird2c
|
||||
PROVIDES:=fff-babel-implementation
|
||||
CONFLICTS:=fff-babeld
|
||||
endef
|
||||
|
||||
define Package/fff-babel-bird2/description
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
/etc/init.d/bird disable
|
||||
|
||||
exit 0
|
|
@ -44,7 +44,7 @@ babel_apply() {
|
|||
return 0
|
||||
}
|
||||
|
||||
babel_reload() {
|
||||
babel_reload_implementation() {
|
||||
# Change include file path, so bird uses the correct configuration, depending on the configuration state:
|
||||
# - If test mode is active (and /tmp/bird-babel exists), switch to the temporary (/tmp) configuration to be tested.
|
||||
# - If new settings are applied or the old settings are restored after an unsuccessful test (and /tmp/bird-babel does not exist),
|
|
@ -1,4 +1,6 @@
|
|||
. /lib/functions/fff/babeldaemon
|
||||
|
||||
implementation=babeld
|
||||
. /lib/functions/fff/babeldaemon/$implementation
|
||||
|
||||
babel_add_iifrules() {
|
||||
[ "$#" -ne "1" ] && return 1
|
||||
|
@ -62,3 +64,26 @@ babel_add_peer6addr() {
|
|||
|
||||
return 0
|
||||
}
|
||||
|
||||
babel_reload() {
|
||||
# switch implementation
|
||||
case $implementation in
|
||||
bird2)
|
||||
/etc/init.d/babeld stop 2>/dev/null
|
||||
/etc/init.d/babeld disable
|
||||
/etc/init.d/bird enable
|
||||
/etc/init.d/bird start
|
||||
;;
|
||||
babeld)
|
||||
/etc/init.d/bird stop 2>/dev/null
|
||||
/etc/init.d/bird disable
|
||||
/etc/init.d/babeld enable
|
||||
/etc/init.d/babeld start
|
||||
;;
|
||||
esac
|
||||
|
||||
# call implementation-specific reload commands
|
||||
babel_reload_implementation
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
/etc/init.d/babeld disable
|
||||
|
||||
exit 0
|
|
@ -63,7 +63,7 @@ babel_apply() {
|
|||
uci commit babeld
|
||||
}
|
||||
|
||||
babel_reload() {
|
||||
babel_reload_implementation() {
|
||||
return 0
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ define Package/fff-layer3
|
|||
DEPENDS:=+fff-alfred-monitoring-proxy \
|
||||
+fff-babel \
|
||||
+fff-babeld \
|
||||
+fff-babel-bird2 \
|
||||
+fff-boardname \
|
||||
+fff-dhcp \
|
||||
+fff-layer3-config \
|
||||
|
|
Loading…
Reference in New Issue