Merge pull request #497 from ecsv/alfred-multiif
alfred: Interface init script fixes
This commit is contained in:
commit
ec287ab088
3 changed files with 16 additions and 7 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=alfred
|
PKG_NAME:=alfred
|
||||||
PKG_VERSION:=2019.3
|
PKG_VERSION:=2019.3
|
||||||
PKG_RELEASE:=0
|
PKG_RELEASE:=2
|
||||||
PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766
|
PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
config 'alfred' 'alfred'
|
config 'alfred' 'alfred'
|
||||||
option interface 'br-lan'
|
list interface 'br-lan'
|
||||||
option mode 'master'
|
option mode 'master'
|
||||||
option batmanif 'bat0'
|
option batmanif 'bat0'
|
||||||
option start_vis '1'
|
option start_vis '1'
|
||||||
|
|
|
@ -54,10 +54,17 @@ wait_for_ll_address() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
append_interface()
|
||||||
|
{
|
||||||
|
append "interfaces" "$1" ","
|
||||||
|
wait_for_ll_address "$1"
|
||||||
|
}
|
||||||
|
|
||||||
alfred_start() {
|
alfred_start() {
|
||||||
local args=""
|
local args=""
|
||||||
local section="$1"
|
local section="$1"
|
||||||
local disabled interface mode
|
local disabled interface mode
|
||||||
|
local interfaces
|
||||||
|
|
||||||
# check if section is disabled
|
# check if section is disabled
|
||||||
config_get_bool disabled "$section" disabled 0
|
config_get_bool disabled "$section" disabled 0
|
||||||
|
@ -65,8 +72,12 @@ alfred_start() {
|
||||||
|
|
||||||
args=""
|
args=""
|
||||||
|
|
||||||
config_get interface "$section" interface
|
config_list_foreach "$section" "interface" append_interface
|
||||||
append args "-i $interface"
|
if [ -z "$interfaces" ]; then
|
||||||
|
config_get interface "$section" interface
|
||||||
|
append_interface "$interface"
|
||||||
|
fi
|
||||||
|
append args "-i $interfaces"
|
||||||
|
|
||||||
config_get mode "$section" mode
|
config_get mode "$section" mode
|
||||||
[ "$mode" = "master" ] && append args "-m"
|
[ "$mode" = "master" ] && append args "-m"
|
||||||
|
@ -75,11 +86,9 @@ alfred_start() {
|
||||||
append args "-b $batmanif"
|
append args "-b $batmanif"
|
||||||
|
|
||||||
if [ "$batmanif" != "none" ]; then
|
if [ "$batmanif" != "none" ]; then
|
||||||
wait_for_dir "$batmanif" "/sys/class/net/$batmanif/mesh"
|
wait_for_dir "$batmanif" "/sys/devices/virtual/net/$batmanif"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wait_for_ll_address "$interface"
|
|
||||||
|
|
||||||
append alfred_args "$args"
|
append alfred_args "$args"
|
||||||
enable=1
|
enable=1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue