Skip to content
Snippets Groups Projects
Commit 89e8f705 authored by Arne Jonsson's avatar Arne Jonsson
Browse files

openwrt_core: use OpenWrt way to define LAN/WAN ports

parent 96f019f3
No related branches found
No related tags found
1 merge request!545openwrt_core: use OpenWrt way to define LAN/WAN ports
#!/bin/sh
# Set default LAN, WAN and possibly switch interfaces for Iopsys
source /lib/functions/uci-defaults.sh
board_config_update
# Have we been here done before?
json_is_a network object && exit 0
ethernetLanPorts="$(db -q get hw.board.ethernetLanPorts)"
wanEthernetPort="$(db -q get hw.board.ethernetWanPort)"
[ -n "$ethernetLanPorts" ] && ucidef_set_interface_lan "$ethernetLanPorts"
if [ -n "$wanEthernetPort" ]; then # Ethernet WAN Port
ucidef_set_interface_wan "$wanEthernetPort"
else # No Ethernet WAN Port found, check for PON
if [ -d /sys/module/bcmgpon ]; then # Broadcom PON
ucidef_set_interface_wan "veip0"
elif [ -d /sys/module/xpon ]; then # Airoha PON
ucidef_set_interface_wan "pon"
fi
fi
board_config_flush
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment