netmode: 1.1.8

This commit is contained in:
Vivek Kumar Dutta 2025-10-28 15:29:17 +05:30
parent 64cf5c7c9f
commit 924675d271
No known key found for this signature in database
GPG key ID: 4E09F5AD8265FD4C
3 changed files with 10 additions and 3 deletions

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netmode
PKG_VERSION:=1.1.7
PKG_VERSION:=1.1.8
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only

View file

@ -4,13 +4,19 @@ enabled="$(uci -q get netmode.global.enabled)"
[ "$enabled" == "1" ] || exit 0
mode="$(uci -q get netmode.global.mode)"
[ -n "$mode" ] && exit 0
wanproto=$(uci -q get network.wan.proto)
if [ -n "$mode" ]; then
# check if wanproto and mode aligned
if [ "${mode}" = "routed-${wanproto}" ]; then
exit 0
fi
fi
[ -f /etc/netmodes/supported_modes.json ] || exit 0
# NetMode is enabled without a Mode being set
# Figure out the current mode from network config
wanproto=$(uci -q get network.wan.proto)
curmode=""
case "$wanproto" in
dhcp) curmode="routed-dhcp" ;;

View file

@ -0,0 +1 @@
/etc/netmodes/.last_mode