Skip to content

Commit

Permalink
gluon-mesh-batman-adv: add UCI setting for hop penalty
Browse files Browse the repository at this point in the history
Add a UCI setting gluon.mesh_batman_adv.hop_penalty

Example UCI commands:

    uci set gluon.mesh_batman_adv=mesh_batman_adv
    uci set gluon.mesh_batman_adv.hop_penalty=20
    uci commit

`/etc/config/gluon` config section:

    config mesh_batman_adv 'mesh_batman_adv'
    	option hop_penalty '20'

Fixes: freifunk-gluon#1942
  • Loading branch information
neocturne committed Apr 20, 2020
1 parent 5c8c479 commit 778bf90
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ lookup_site() {
lua -e "print(require('gluon.site').$path('$default'))"
}

lookup_uci() {
local path="$1" default="$2"
uci -q get "$path" || echo "$default"
}

proto_gluon_bat0_renew() {
local config="$1"

Expand All @@ -41,7 +46,7 @@ proto_gluon_bat0_setup() {
batctl interface create

batctl orig_interval 5000
batctl hop_penalty 15
batctl hop_penalty "$(lookup_uci 'gluon.mesh_batman_adv.hop_penalty' 15)"
batctl multicast_mode 0

case "$gw_mode" in
Expand Down

0 comments on commit 778bf90

Please sign in to comment.