Set tunnel weight to 1 and provide UI to change it. (#937)

This commit is contained in:
Tim Wilkinson 2023-09-19 20:04:54 -07:00 committed by GitHub
parent eab36f4788
commit 272d53bab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -3,6 +3,7 @@ if [ "$(/sbin/uci -c /etc/config.mesh -q get aredn.@tunnel[0])" != "tunnel" ]; t
/sbin/uci -c /etc/config.mesh -q add aredn tunnel
/sbin/uci -c /etc/config.mesh -q set aredn.@tunnel[0].maxclients=10
/sbin/uci -c /etc/config.mesh -q set aredn.@tunnel[0].maxservers=10
/sbin/uci -c /etc/config.mesh -q set aredn.@tunnel[0].weight=1
/sbin/uci -c /etc/config.mesh -q commit aredn
fi
clients=$(/sbin/uci -c /etc/config.mesh -q get aredn.@tunnel[0].maxclients)
@ -22,3 +23,9 @@ config interface 'tun$tun'
__EOT__
done
fi
# Default tunnel weight to 1 (perfect RF)
if [ "$(/sbin/uci -c /etc/config.mesh -q get aredn.@tunnel[0].weight)" = "" ]; then
/sbin/uci -c /etc/config.mesh -q set aredn.@tunnel[0].weight=1
/sbin/uci -c /etc/config.mesh -q commit aredn
fi

View File

@ -263,6 +263,14 @@ local settings = {
precallback = "restrictTunnelLimitToValidRange()",
postcallback = "adjustTunnelInterfaceCount()"
},
{
category = "Tunnel Options",
key = "aredn.@tunnel[0].weight",
type = "string",
desc = "<b>Tunnel Weight</b> specifies the cost of using a tunnel. The higher the number, the less likely a tunnel is used.<br><br><small>aredn.@tunnel[0].weighy</small>",
default = "1",
needreboot= true
},
{
category = "Tunnel Options",
key = "aredn.@tunnel[0].wanonly",